{"action":"opened","issue":{"url":"https://api.github.com/repos/Lukeghenco/phoenix-todo-client/issues/2","repository_url":"https://api.github.com/repos/Lukeghenco/phoenix-todo-client","labels_url":"https://api.github.com/repos/Lukeghenco/phoenix-todo-client/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Lukeghenco/phoenix-todo-client/issues/2/comments","events_url":"https://api.github.com/repos/Lukeghenco/phoenix-todo-client/issues/2/events","html_url":"https://github.com/Lukeghenco/phoenix-todo-client/issues/2","id":220470463,"number":2,"title":"Create API service","user":{"login":"Lukeghenco","id":15013243,"avatar_url":"https://avatars1.githubusercontent.com/u/15013243?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukeghenco","html_url":"https://github.com/Lukeghenco","followers_url":"https://api.github.com/users/Lukeghenco/followers","following_url":"https://api.github.com/users/Lukeghenco/following{/other_user}","gists_url":"https://api.github.com/users/Lukeghenco/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukeghenco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukeghenco/subscriptions","organizations_url":"https://api.github.com/users/Lukeghenco/orgs","repos_url":"https://api.github.com/users/Lukeghenco/repos","events_url":"https://api.github.com/users/Lukeghenco/events{/privacy}","received_events_url":"https://api.github.com/users/Lukeghenco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-09T13:17:43Z","updated_at":"2017-04-09T13:17:43Z","closed_at":null,"body":"Create a DRY Api service that sets headers with or without JWT token and parses responses to JSON. The idea is to be able to call \r\n\r\n```\r\nreturn ApiService.post('/activities, activity)\r\n  .then(activity => render(activity))\r\n```\r\n\r\ninstead of \r\n\r\n```\r\nreturn fetch('/activities, {\r\n  method: 'POST',\r\n  headers: {\r\n    'Accept': 'application/json',\r\n    'Authorization': 'Bearer abc.123.def.456',\r\n    'Content-Type': 'application/json'\r\n  }, \r\n  body: JSON.stringify(activity)\r\n})\r\n.then(response => response.json())\r\n.then(activity => render(activity))\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"Lukeghenco"}}