{"action":"created","issue":{"url":"https://api.github.com/repos/socialradar/batch-request/issues/20","repository_url":"https://api.github.com/repos/socialradar/batch-request","labels_url":"https://api.github.com/repos/socialradar/batch-request/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/socialradar/batch-request/issues/20/comments","events_url":"https://api.github.com/repos/socialradar/batch-request/issues/20/events","html_url":"https://github.com/socialradar/batch-request/pull/20","id":158443780,"number":20,"title":"Added support for multiple dependencies and using response data in dependent request","user":{"login":"ggutenberg","id":1128406,"avatar_url":"https://avatars.githubusercontent.com/u/1128406?v=3","gravatar_id":"","url":"https://api.github.com/users/ggutenberg","html_url":"https://github.com/ggutenberg","followers_url":"https://api.github.com/users/ggutenberg/followers","following_url":"https://api.github.com/users/ggutenberg/following{/other_user}","gists_url":"https://api.github.com/users/ggutenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ggutenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggutenberg/subscriptions","organizations_url":"https://api.github.com/users/ggutenberg/orgs","repos_url":"https://api.github.com/users/ggutenberg/repos","events_url":"https://api.github.com/users/ggutenberg/events{/privacy}","received_events_url":"https://api.github.com/users/ggutenberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-03T20:01:34Z","updated_at":"2016-06-03T20:12:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/socialradar/batch-request/pulls/20","html_url":"https://github.com/socialradar/batch-request/pull/20","diff_url":"https://github.com/socialradar/batch-request/pull/20.diff","patch_url":"https://github.com/socialradar/batch-request/pull/20.patch"},"body":"Addresses #4 and #11.\r\n\r\nUses es6 template string syntax for dependent requests - https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals\r\n\r\nEx:\r\n```\r\n{\r\n    getEmail: {\r\n        url: 'http://localhost:3000/users/1/email'\r\n    },\r\n    getName: {\r\n        url: 'http://localhost:3000/users/1/name'\r\n    },\r\n    deepReflection: {\r\n        dependency: ['getEmail', 'getName'],\r\n        method: 'POST',\r\n        body: { email: '${dependency[0].body}', name: '${dependency[1].body}' },\r\n        json: true,\r\n        url: 'http://localhost:3000/users/1/deep'\r\n    }\r\n}\r\n```\r\n\r\nNotes:\r\n\r\nIf using the response from a dependency, the dependency property *must* be an array, and the es6 template reference *must* reference the dependency index you wish to use.\r\n\r\nThe code will now attempt to `JSON.parse()` a JSON body if the response header is `Content-Type: application/json`.\r\n\r\nI have a fast computer, and the arbitrary time additions in the tests were causing them to fail (ex. server delays 250, but the test was looking for > 999 delta, but it was only ~300 delta for me), so instead of checking `> time + 999` i changed them to `> time`."},"comment":{"url":"https://api.github.com/repos/socialradar/batch-request/issues/comments/223682349","html_url":"https://github.com/socialradar/batch-request/pull/20#issuecomment-223682349","issue_url":"https://api.github.com/repos/socialradar/batch-request/issues/20","id":223682349,"user":{"login":"victorquinn","id":660139,"avatar_url":"https://avatars.githubusercontent.com/u/660139?v=3","gravatar_id":"","url":"https://api.github.com/users/victorquinn","html_url":"https://github.com/victorquinn","followers_url":"https://api.github.com/users/victorquinn/followers","following_url":"https://api.github.com/users/victorquinn/following{/other_user}","gists_url":"https://api.github.com/users/victorquinn/gists{/gist_id}","starred_url":"https://api.github.com/users/victorquinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorquinn/subscriptions","organizations_url":"https://api.github.com/users/victorquinn/orgs","repos_url":"https://api.github.com/users/victorquinn/repos","events_url":"https://api.github.com/users/victorquinn/events{/privacy}","received_events_url":"https://api.github.com/users/victorquinn/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T20:12:37Z","updated_at":"2016-06-03T20:12:37Z","body":"Wow, this is an awesome chunk of changes @ggutenberg ! Much appreciated :+1: "}}
{"actor":{"display_login":"victorquinn"}}