Skip to content

Commit 3be0f54

Browse files
author
Robert Ross
committed
Add parameters documentation for request bodies.
1 parent e6db7e7 commit 3be0f54

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.markdown

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ along with any named parameters you specify in your route strings.
143143
end
144144
```
145145

146+
Parameters are also populated from the request body on POST and PUT for JSON and XML content-types.
147+
148+
The Request:
149+
```curl -d '{"some_key": "some_value"}' 'http://readercity.com/json_endpoint' -H Content-Type:application/json -v```
150+
151+
152+
The Grape Endpoint:
153+
```ruby
154+
post '/json_endpoint' do
155+
params[:some_key]
156+
end
157+
```
158+
146159
## Headers
147160

148161
Headers are available through the `env` hash object.

0 commit comments

Comments
 (0)