mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Update README.md (#646)
This commit is contained in:
parent
290aa62c33
commit
011c1ac3e3
1 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ Makes http fun again!
|
||||||
## Parsing JSON
|
## Parsing JSON
|
||||||
If the response Content Type is `application/json`, HTTParty will parse the response and return Ruby objects such as a hash or array. The default behavior for parsing JSON will return keys as strings. This can be supressed with the `format` option. To get hash keys as symbols:
|
If the response Content Type is `application/json`, HTTParty will parse the response and return Ruby objects such as a hash or array. The default behavior for parsing JSON will return keys as strings. This can be supressed with the `format` option. To get hash keys as symbols:
|
||||||
|
|
||||||
```
|
```ruby
|
||||||
response = HTTParty.get('http://example.com', format: :plain)
|
response = HTTParty.get('http://example.com', format: :plain)
|
||||||
JSON.parse response, symbolize_names: true
|
JSON.parse response, symbolize_names: true
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue