Updating json sample
There is a new syntax for this now. You need to write env.response.content_type
This commit is contained in:
parent
0a1abe9a42
commit
9e95ea7ea0
1 changed files with 1 additions and 1 deletions
|
@ -4,6 +4,6 @@ require "json"
|
||||||
# You can easily access the context and set content_type like 'application/json'.
|
# You can easily access the context and set content_type like 'application/json'.
|
||||||
# Look how easy to build a JSON serving API.
|
# Look how easy to build a JSON serving API.
|
||||||
get "/" do |env|
|
get "/" do |env|
|
||||||
env.content_type = "application/json"
|
env.response.content_type = "application/json"
|
||||||
{name: "Serdar", age: 27}.to_json
|
{name: "Serdar", age: 27}.to_json
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue