{"action":"created","issue":{"url":"https://api.github.com/repos/Botnary/wp-slim-framework/issues/3","labels_url":"https://api.github.com/repos/Botnary/wp-slim-framework/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Botnary/wp-slim-framework/issues/3/comments","events_url":"https://api.github.com/repos/Botnary/wp-slim-framework/issues/3/events","html_url":"https://github.com/Botnary/wp-slim-framework/issues/3","id":55439698,"number":3,"title":"CORS Headers and Content-Type settings","user":{"login":"jancel","id":157374,"avatar_url":"https://avatars.githubusercontent.com/u/157374?v=3","gravatar_id":"","url":"https://api.github.com/users/jancel","html_url":"https://github.com/jancel","followers_url":"https://api.github.com/users/jancel/followers","following_url":"https://api.github.com/users/jancel/following{/other_user}","gists_url":"https://api.github.com/users/jancel/gists{/gist_id}","starred_url":"https://api.github.com/users/jancel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jancel/subscriptions","organizations_url":"https://api.github.com/users/jancel/orgs","repos_url":"https://api.github.com/users/jancel/repos","events_url":"https://api.github.com/users/jancel/events{/privacy}","received_events_url":"https://api.github.com/users/jancel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-26T01:52:49Z","updated_at":"2015-01-26T13:52:59Z","closed_at":null,"body":"Can we set the HTTP headers through this library?  I'm having a fuss getting CORS requests working or content type set to json for the response.  Hoping this can accomodate."},"comment":{"url":"https://api.github.com/repos/Botnary/wp-slim-framework/issues/comments/71463235","html_url":"https://github.com/Botnary/wp-slim-framework/issues/3#issuecomment-71463235","issue_url":"https://api.github.com/repos/Botnary/wp-slim-framework/issues/3","id":71463235,"user":{"login":"Botnary","id":143590,"avatar_url":"https://avatars.githubusercontent.com/u/143590?v=3","gravatar_id":"","url":"https://api.github.com/users/Botnary","html_url":"https://github.com/Botnary","followers_url":"https://api.github.com/users/Botnary/followers","following_url":"https://api.github.com/users/Botnary/following{/other_user}","gists_url":"https://api.github.com/users/Botnary/gists{/gist_id}","starred_url":"https://api.github.com/users/Botnary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Botnary/subscriptions","organizations_url":"https://api.github.com/users/Botnary/orgs","repos_url":"https://api.github.com/users/Botnary/repos","events_url":"https://api.github.com/users/Botnary/events{/privacy}","received_events_url":"https://api.github.com/users/Botnary/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T13:52:59Z","updated_at":"2015-01-26T13:52:59Z","body":"There are no other requirements, you can use Slim framework response object:\r\n```\r\n$response = $app->response();\r\n$response['Content-Type'] = 'application/json';\r\n$response['X-Powered-By'] = 'Potato Energy';\r\n$response->status(200);\r\n// etc.\r\n\r\n$response->body(json_encode($dataAry));\r\n```\r\nor use the PHP old way\r\n\r\n```\r\nheader(\"Content-Type: application/json\");\r\necho json_encode($result);\r\nexit;\r\n\r\n```\r\nUse a dev tool to check the headers in your browser."}}