{"action":"created","issue":{"url":"https://api.github.com/repos/dart-embla/embla/issues/2","repository_url":"https://api.github.com/repos/dart-embla/embla","labels_url":"https://api.github.com/repos/dart-embla/embla/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/dart-embla/embla/issues/2/comments","events_url":"https://api.github.com/repos/dart-embla/embla/issues/2/events","html_url":"https://github.com/dart-embla/embla/issues/2","id":138785050,"number":2,"title":"Set header","user":{"login":"indiealexh","id":1066212,"avatar_url":"https://avatars.githubusercontent.com/u/1066212?v=3","gravatar_id":"","url":"https://api.github.com/users/indiealexh","html_url":"https://github.com/indiealexh","followers_url":"https://api.github.com/users/indiealexh/followers","following_url":"https://api.github.com/users/indiealexh/following{/other_user}","gists_url":"https://api.github.com/users/indiealexh/gists{/gist_id}","starred_url":"https://api.github.com/users/indiealexh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indiealexh/subscriptions","organizations_url":"https://api.github.com/users/indiealexh/orgs","repos_url":"https://api.github.com/users/indiealexh/repos","events_url":"https://api.github.com/users/indiealexh/events{/privacy}","received_events_url":"https://api.github.com/users/indiealexh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-06T11:48:04Z","updated_at":"2016-03-06T11:55:51Z","closed_at":null,"body":"Do you have a built in way currently to set and read header variables?\r\nSuch as cors, application type, authentication headers etc?\r\n\r\nI would like to use Embla for creating rest services, including versioning and authentication if I can."},"comment":{"url":"https://api.github.com/repos/dart-embla/embla/issues/comments/192879846","html_url":"https://github.com/dart-embla/embla/issues/2#issuecomment-192879846","issue_url":"https://api.github.com/repos/dart-embla/embla/issues/2","id":192879846,"user":{"login":"emilniklas","id":4621839,"avatar_url":"https://avatars.githubusercontent.com/u/4621839?v=3","gravatar_id":"","url":"https://api.github.com/users/emilniklas","html_url":"https://github.com/emilniklas","followers_url":"https://api.github.com/users/emilniklas/followers","following_url":"https://api.github.com/users/emilniklas/following{/other_user}","gists_url":"https://api.github.com/users/emilniklas/gists{/gist_id}","starred_url":"https://api.github.com/users/emilniklas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilniklas/subscriptions","organizations_url":"https://api.github.com/users/emilniklas/orgs","repos_url":"https://api.github.com/users/emilniklas/repos","events_url":"https://api.github.com/users/emilniklas/events{/privacy}","received_events_url":"https://api.github.com/users/emilniklas/received_events","type":"User","site_admin":false},"created_at":"2016-03-06T11:55:51Z","updated_at":"2016-03-06T11:55:51Z","body":"Hey, @indiealexh!\n\nEmbla uses [Shelf](https://pub.dartlang.org/packages/shelf) for the HTTP request/response cycle.\n\nYou can return Shelf responses directly in handlers, and `embla/http.dart` exposes that class, so to add headers you can do this:\n\n```\nimport 'package:embla/http.dart';\nexport 'package:embla/bootstrap.dart';\n\nget embla => [\n  new HttpBootstrapper(\n    pipeline: pipe(\n      () => new Response.ok('Hello!', headers: {\n            'Content-Type': 'text/plain'\n          })\n    )\n  )\n];\n```\n\nCheck out the Shelf documentation for more details about the Response class."}}