{"action":"created","issue":{"url":"https://api.github.com/repos/channelcat/sanic/issues/23","repository_url":"https://api.github.com/repos/channelcat/sanic","labels_url":"https://api.github.com/repos/channelcat/sanic/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/channelcat/sanic/issues/23/comments","events_url":"https://api.github.com/repos/channelcat/sanic/issues/23/events","html_url":"https://github.com/channelcat/sanic/pull/23","id":183236332,"number":23,"title":"refactored response object model","user":{"login":"sm5art","id":1732946,"avatar_url":"https://avatars.githubusercontent.com/u/1732946?v=3","gravatar_id":"","url":"https://api.github.com/users/sm5art","html_url":"https://github.com/sm5art","followers_url":"https://api.github.com/users/sm5art/followers","following_url":"https://api.github.com/users/sm5art/following{/other_user}","gists_url":"https://api.github.com/users/sm5art/gists{/gist_id}","starred_url":"https://api.github.com/users/sm5art/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sm5art/subscriptions","organizations_url":"https://api.github.com/users/sm5art/orgs","repos_url":"https://api.github.com/users/sm5art/repos","events_url":"https://api.github.com/users/sm5art/events{/privacy}","received_events_url":"https://api.github.com/users/sm5art/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-15T22:20:39Z","updated_at":"2016-10-16T04:57:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/channelcat/sanic/pulls/23","html_url":"https://github.com/channelcat/sanic/pull/23","diff_url":"https://github.com/channelcat/sanic/pull/23.diff","patch_url":"https://github.com/channelcat/sanic/pull/23.patch"},"body":"I want to change how the Response model works by creating an object that allows intermediary header changing, and overall response changing. \r\n\r\nFor the future of this framework, the response should be modified so that more complicated responses like cookies can be used.\r\n\r\ni.e\r\n```python\r\nclass Response:\r\n    pass\r\n    \r\n    def set_cookie(self, name, value):\r\n         self.add_headers(\"Cookie\":\"{}={}\".format(name,value))\r\n```\r\nwhich will be used like this\r\n\r\n```python\r\n@app.route(\"/\")\r\ndef handler(req, res):\r\n    res.set_cookie(\"hello\", \"world\")\r\n    return res.json({\"hello\":\"world\")\r\n```\r\nwhere res is instantiated into the handler by the main sanic.py.\r\n\r\nThis type of structure will allow better response formulation rather than using the bare response types and pushing in the headers manually. We can write stuff like cookies that will be reused.\r\n\r\nMy next PR will be implementing cookies. \r\n\r\nThis is experimental, I just want to know what you think"},"comment":{"url":"https://api.github.com/repos/channelcat/sanic/issues/comments/254027640","html_url":"https://github.com/channelcat/sanic/pull/23#issuecomment-254027640","issue_url":"https://api.github.com/repos/channelcat/sanic/issues/23","id":254027640,"user":{"login":"sm5art","id":1732946,"avatar_url":"https://avatars.githubusercontent.com/u/1732946?v=3","gravatar_id":"","url":"https://api.github.com/users/sm5art","html_url":"https://github.com/sm5art","followers_url":"https://api.github.com/users/sm5art/followers","following_url":"https://api.github.com/users/sm5art/following{/other_user}","gists_url":"https://api.github.com/users/sm5art/gists{/gist_id}","starred_url":"https://api.github.com/users/sm5art/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sm5art/subscriptions","organizations_url":"https://api.github.com/users/sm5art/orgs","repos_url":"https://api.github.com/users/sm5art/repos","events_url":"https://api.github.com/users/sm5art/events{/privacy}","received_events_url":"https://api.github.com/users/sm5art/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T04:57:21Z","updated_at":"2016-10-16T04:57:21Z","body":"ill take a look into it\r\n"}}
{"actor":{"display_login":"sm5art"}}