Skip to content

Commit

Permalink
Move Parsing JSON to Docs page
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeu2000 committed Nov 14, 2016
1 parent 43fafbf commit 41a90a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ puts stack_exchange.users

See the [examples directory](http://github.com/jnunemaker/httparty/tree/master/examples) for even more goodies.

## JSON Parsing
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:

```
response = HTTParty.get('http://example.com', format: :plain)
JSON.parse response, symbolize_names: true
```

## Command Line Interface

httparty also includes the executable `httparty` which can be
Expand Down
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
Makes http fun again!

## Table of contents
- [Parsing JSON](#parsing-json)
- [Working with SSL](#working-with-ssl)

## 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:

```
response = HTTParty.get('http://example.com', format: :plain)
JSON.parse response, symbolize_names: true
```

## Working with SSL

You can use this guide to work with SSL certificates.
Expand Down

0 comments on commit 41a90a7

Please sign in to comment.