diff --git a/README.md b/README.md index 83a6c13..c9f6cc3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/README.md b/docs/README.md index 6513ffd..cfb63af 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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.