> For the complete documentation index, see [llms.txt](https://xiaohesong.gitbook.io/today-i-learn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xiaohesong.gitbook.io/today-i-learn/http/response.md).

# response

* HTTP get response to json, playable

  \`\`\`ruby

  **like http get**

  response = "{\n  \\"userId\\": 1,\n  \\"id\\": 1,\n  \\"title\\": \\"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\\"\n}"

## first

body = JSON.parse(response) =>{"userId"=>1, "id"=>1, "title"=>"sunt aut facere repellat provident occaecati excepturi optio reprehenderit"} body\["id"] => 1

## second

body = JSON.parse(response, symbolize\_names: true) => {:userId=>1, :id=>1, :title=>"sunt aut facere repellat provident occaecati excepturi optio reprehenderit"} body\[:id] => 1

## third

body = JSON.parse(response, object\_class: OpenStruct) => # body.id => 1

\`\`\`
