I use postman to test api, it send WebKitFormBoundary data with form-data content-type.
But grape cannot recognize
Can you provide some detail, maybe a curl repro聽or test or example? Usually a POST gets parsed by Rack::Utils::Multipart and this looks like multipart form data.
I use Postman for api test

and this following request is catch from Charles(a web debug proxy)
POST /api/v1/topic HTTP/1.1
Host: localhost:3000
Content-Length: 147
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Content-Type: multipart/form-data
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Postman-Token: cea8c580-15da-3602-c6df-7cad170c5175
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2,ja;q=0.2
------WebKitFormBoundaryg8BnIGABK4VLD2Be
Content-Disposition: form-data; name="title"
12312321312
------WebKitFormBoundaryg8BnIGABK4VLD2Be--
Notice the WebKitFormBoundary....., this maybe mean request is from webkit browser.
You should write a spec for this in Grape next. I think we want to support this out of the box.
@TangMonk I'm trying to reproduce it, but I can't. I have tried to reproduce it with a minimal grape app:
class Example < Grape::API
resource :test do
params do
requires :title, type: String
end
post :la do
params[:title]
end
end
end
I'm sending a post request with postman:
POST /test/la HTTP/1.1
Host: localhost:9292
Cache-Control: no-cache
Postman-Token: 01dea549-fbe1-ee26-fd9f-b5d6ebba57f2
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="title"
Another title
----WebKitFormBoundary7MA4YWxkTrZu0gW
But I get a 201 (as expected):
::1 - - [20/Sep/2015:11:48:34 +0200] "POST /test/la HTTP/1.1" 201 13 0.0328
and the title in the response.
If you compare both requests, yours and mine, you can see one important difference:
Yours:
Content-Type: multipart/form-data
Mine:
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
The boundary parameter is what the server uses to split the parameters in a multipart/form-data, you can see a good explanation here: http://stackoverflow.com/questions/3508338/what-is-the-boundary-in-multipart-form-data, and WebKitFormBoundary is just a name (and by the way, postman uses chrome).
So the problem seems to be that your postman is missing the boundary param, could you check the postman version, or any headers or settings you may have changed?
@dblock could you remove the feature request tag, please?
@towanda, I figure it out, I just add content type manually to postman

When I remove it, it works normally.
Thanks
Thanks for jumping in @towanda.

Most helpful comment
@towanda, I figure it out, I just add content type manually to postman
When I remove it, it works normally.
Thanks