From 9e95ea7ea055f1744be44a00c749748ff1be26bc Mon Sep 17 00:00:00 2001 From: Stephan Nordnes Eriksen Date: Fri, 29 Jan 2016 12:31:00 +0100 Subject: [PATCH] Updating json sample There is a new syntax for this now. You need to write env.response.content_type --- samples/json_api.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/json_api.cr b/samples/json_api.cr index a10a4e8..54e0598 100644 --- a/samples/json_api.cr +++ b/samples/json_api.cr @@ -4,6 +4,6 @@ require "json" # You can easily access the context and set content_type like 'application/json'. # Look how easy to build a JSON serving API. get "/" do |env| - env.content_type = "application/json" + env.response.content_type = "application/json" {name: "Serdar", age: 27}.to_json end