mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Mention Content-Type for JSON params parsing.
http://stackoverflow.com/questions/8501021/rails-json-request-is-not-parsed-correctly-into-post-parameters
This commit is contained in:
parent
059f9f0394
commit
b437502f8b
1 changed files with 1 additions and 1 deletions
|
@ -129,7 +129,7 @@ Note that the `params` hash is actually an instance of `ActiveSupport::HashWithI
|
|||
|
||||
### JSON parameters
|
||||
|
||||
If you're writing a web service application, you might find yourself more comfortable accepting parameters in JSON format. Rails will automatically convert your parameters into the `params` hash, which you can access as you would normally.
|
||||
If you're writing a web service application, you might find yourself more comfortable accepting parameters in JSON format. If the "Content-Type" header of your request is set to "application/json", Rails will automatically convert your parameters into the `params` hash, which you can access as you would normally.
|
||||
|
||||
So for example, if you are sending this JSON content:
|
||||
|
||||
|
|
Loading…
Reference in a new issue