Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restfuse POST file does not frame the request correctly #64

Open
gammay opened this issue Dec 12, 2014 · 0 comments
Open

Restfuse POST file does not frame the request correctly #64

gammay opened this issue Dec 12, 2014 · 0 comments

Comments

@gammay
Copy link

gammay commented Dec 12, 2014

Following is the restfuse test case to send a file:

    @HttpTest(method = Method.POST, path = "/api/test/file/v1", 
            type = MediaType.MULTIPART_FORM_DATA,
            headers = {
                @Header(name = "Content-Type", value = "multipart/form-data; boundary=--ABC")
            },
            file = "/test.txt"
    )
    public void testPostFile() {
        Assert.assertOk(response);
    }

This sends HTTP request as below:

POST http://localhost:8888/api/test/file/v1 HTTP/1.1
Content-Type: multipart/form-data; boundary=--ABC
User-Agent: Java/1.7.0_21
Host: localhost:8888
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 9

TEST!!!

When the same request is sent through Postman chrome extension, the request is:

POST http://localhost:8080/api/test/file/v1 HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Content-Length: 191
Cache-Control: no-cache
Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
type: multipart/form-data
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryegsX8TPws99lAi9O
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Cookie: __atuvc=1%7C39; CUSTOMER_UUID=cd9fbf8b-1248-4773-80fe-917d7abd0a38

------WebKitFormBoundaryegsX8TPws99lAi9O
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain

TEST!!!

------WebKitFormBoundaryegsX8TPws99lAi9O--

Restfuse does not seem to add the file boundaries automatically. What are we missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant