Skip to content

Allow parameters, such as content encoding, in content_type.#508

Merged
dblock merged 1 commit intoruby-grape:masterfrom
dm1try:content_type_with_params
Nov 12, 2013
Merged

Allow parameters, such as content encoding, in content_type.#508
dblock merged 1 commit intoruby-grape:masterfrom
dm1try:content_type_with_params

Conversation

@dm1try
Copy link
Copy Markdown
Member

@dm1try dm1try commented Nov 12, 2013

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".

@dblock
Copy link
Copy Markdown
Member

dblock commented Nov 12, 2013

This is a good change, could you update CHANGELOG please (via a git commit --amend). Thanks.

@dm1try
Copy link
Copy Markdown
Member Author

dm1try commented Nov 12, 2013

@dblock , I'm not sure about description. It's more like a fix for POST/PUT requests with specific content type.
What do you think?

Comment thread spec/grape/endpoint_spec.rb Outdated
Copy link
Copy Markdown
Member

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'.

@dblock
Copy link
Copy Markdown
Member

dblock commented Nov 12, 2013

I think it should be something like "Allow parameters, such as content encoding, in content_type."

Comment thread spec/grape/endpoint_spec.rb Outdated
Copy link
Copy Markdown
Member

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.
@dm1try
Copy link
Copy Markdown
Member Author

dm1try commented Nov 12, 2013

Updated.

dblock added a commit that referenced this pull request Nov 12, 2013
Allow parameters, such as content encoding, in content_type.
@dblock dblock merged commit 7beb328 into ruby-grape:master Nov 12, 2013
@dblock
Copy link
Copy Markdown
Member

dblock commented Nov 12, 2013

Thanks, merged.

@dm1try
Copy link
Copy Markdown
Member Author

dm1try commented Nov 12, 2013

@dblock , thanks for helping me 💛

@dm1try dm1try deleted the content_type_with_params branch November 12, 2013 14:35
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

Successfully merging this pull request may close these issues.

2 participants