-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow parameters, such as content encoding, in content_type. #508
Conversation
This is a good change, could you update CHANGELOG please (via a |
@dblock , I'm not sure about description. It's more like a fix for POST/PUT requests with specific content type. |
@@ -395,6 +395,27 @@ def app | |||
last_response.body.should == '{"error":"The requested content-type \'application/xml\' is not supported."}' | |||
end | |||
|
|||
context 'context type with params' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should say 'content', not 'context'.
I think it should be something like "Allow parameters, such as content encoding, in |
subject.format :json | ||
subject.content_type :json, 'application/json; charset=utf-8' | ||
|
||
subject.post '/request_body' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the path. So just subject.post do
, the path is not necessary, so trying to write less code.
For example, if we define :json content type as "application/json; charset=utf-8" and client do payload(POST/PUT) request with "application/json" type then response should be successful. Ignore content type params in mime_types method.
Updated. |
Allow parameters, such as content encoding, in content_type.
Thanks, merged. |
@dblock , thanks for helping me 💛 |
For example, if we define :json content type as "application/json; charset=utf-8"
and client do payload(POST/PUT) request with "application/json" type then response should be successful.
For now we have an error "The requested content-type 'application/json' is not supported".