{"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/1","id":60993078,"html_url":"https://github.com/sprockets/sprockets.clients.http/pull/1","diff_url":"https://github.com/sprockets/sprockets.clients.http/pull/1.diff","patch_url":"https://github.com/sprockets/sprockets.clients.http/pull/1.patch","issue_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/1","number":1,"state":"open","locked":false,"title":"Initial implementation","user":{"login":"dave-shawley","id":350812,"avatar_url":"https://avatars.githubusercontent.com/u/350812?v=3","gravatar_id":"","url":"https://api.github.com/users/dave-shawley","html_url":"https://github.com/dave-shawley","followers_url":"https://api.github.com/users/dave-shawley/followers","following_url":"https://api.github.com/users/dave-shawley/following{/other_user}","gists_url":"https://api.github.com/users/dave-shawley/gists{/gist_id}","starred_url":"https://api.github.com/users/dave-shawley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dave-shawley/subscriptions","organizations_url":"https://api.github.com/users/dave-shawley/orgs","repos_url":"https://api.github.com/users/dave-shawley/repos","events_url":"https://api.github.com/users/dave-shawley/events{/privacy}","received_events_url":"https://api.github.com/users/dave-shawley/received_events","type":"User","site_admin":false},"body":"This PR implements a very simple HTTP client wrapper with a error handling callback.  The `ClientMixin` class adds a client instance as the `http_client` attribute and exposes a single new method for making HTTP requests -- `make_http_request`.  Calling `make_http_request` looks something like:\r\n```python\r\nresponse = yield self.make_http_request('GET', 'http', 'httpbin.org', 'status', 400)\r\n```\r\nNote that the client takes care of the many of the URL-related details for you though it looks like I forgot to add automatic query encoding *(easy enough to add that shortly)*.  The response is a `tornado.httpclient.HTTPResponse` object.  Failures result in `tornado.web.HTTPError` being raised.  \r\n\r\nYou can specify your own error handling callback by including a `on_error` keyword parameter to `make_http_request`.  It will be called with the request handler instance, the request that was made, and the `sprockets.clients.http.HTTPError` that was raised.  The default looks something like:\r\n```python\r\ndef on_error(handler, request, error):\r\n    raise error.to_server_error()\r\n```\r\n\r\nThe `HTTPClient` class will be useful from things other than `tornado.web.RequestHandler`, *\"yes\", `rejected.Consumer` sub-classes I'm looking at you*.  Though it is little more than a wrapper around `tornado.httpclient.HTTPClient` currently, I want to add smart content handling in the client class in the near future.  For the time-being, it simply provides some insulation around tornado's `httpclient.HTTPError` and `web.HTTPError` dichotomy by introducing another type named `HTTPError` *(why stop at two right?)* that knows how to convert itself to a `web.HTTPError` which is what we usually want.","created_at":"2016-02-28T14:26:22Z","updated_at":"2016-02-28T14:26:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb3bdf77546cfdf0353786afcd20ffd1849eebed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/1/comments","statuses_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/statuses/31daef908d398ebf47dfa144436ea730c2fccfbb","head":{"label":"sprockets:initial-implementation","ref":"initial-implementation","sha":"31daef908d398ebf47dfa144436ea730c2fccfbb","user":{"login":"sprockets","id":8236802,"avatar_url":"https://avatars.githubusercontent.com/u/8236802?v=3","gravatar_id":"","url":"https://api.github.com/users/sprockets","html_url":"https://github.com/sprockets","followers_url":"https://api.github.com/users/sprockets/followers","following_url":"https://api.github.com/users/sprockets/following{/other_user}","gists_url":"https://api.github.com/users/sprockets/gists{/gist_id}","starred_url":"https://api.github.com/users/sprockets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprockets/subscriptions","organizations_url":"https://api.github.com/users/sprockets/orgs","repos_url":"https://api.github.com/users/sprockets/repos","events_url":"https://api.github.com/users/sprockets/events{/privacy}","received_events_url":"https://api.github.com/users/sprockets/received_events","type":"Organization","site_admin":false},"repo":{"id":52723248,"name":"sprockets.clients.http","full_name":"sprockets/sprockets.clients.http","owner":{"login":"sprockets","id":8236802,"avatar_url":"https://avatars.githubusercontent.com/u/8236802?v=3","gravatar_id":"","url":"https://api.github.com/users/sprockets","html_url":"https://github.com/sprockets","followers_url":"https://api.github.com/users/sprockets/followers","following_url":"https://api.github.com/users/sprockets/following{/other_user}","gists_url":"https://api.github.com/users/sprockets/gists{/gist_id}","starred_url":"https://api.github.com/users/sprockets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprockets/subscriptions","organizations_url":"https://api.github.com/users/sprockets/orgs","repos_url":"https://api.github.com/users/sprockets/repos","events_url":"https://api.github.com/users/sprockets/events{/privacy}","received_events_url":"https://api.github.com/users/sprockets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sprockets/sprockets.clients.http","description":"","fork":false,"url":"https://api.github.com/repos/sprockets/sprockets.clients.http","forks_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/forks","keys_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/teams","hooks_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/hooks","issue_events_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/events{/number}","events_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/events","assignees_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/assignees{/user}","branches_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/branches{/branch}","tags_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/tags","blobs_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/refs{/sha}","trees_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/statuses/{sha}","languages_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/languages","stargazers_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/stargazers","contributors_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/contributors","subscribers_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/subscribers","subscription_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/subscription","commits_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/commits{/sha}","git_commits_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/commits{/sha}","comments_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/comments{/number}","issue_comment_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/comments{/number}","contents_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/contents/{+path}","compare_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/merges","archive_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/downloads","issues_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues{/number}","pulls_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls{/number}","milestones_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/milestones{/number}","notifications_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/labels{/name}","releases_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/releases{/id}","deployments_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/deployments","created_at":"2016-02-28T13:47:29Z","updated_at":"2016-02-28T14:02:29Z","pushed_at":"2016-02-28T14:26:23Z","git_url":"git://github.com/sprockets/sprockets.clients.http.git","ssh_url":"git@github.com:sprockets/sprockets.clients.http.git","clone_url":"https://github.com/sprockets/sprockets.clients.http.git","svn_url":"https://github.com/sprockets/sprockets.clients.http","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sprockets:master","ref":"master","sha":"75e630b20cc836eb1dbdce48c78dcde2fe24c789","user":{"login":"sprockets","id":8236802,"avatar_url":"https://avatars.githubusercontent.com/u/8236802?v=3","gravatar_id":"","url":"https://api.github.com/users/sprockets","html_url":"https://github.com/sprockets","followers_url":"https://api.github.com/users/sprockets/followers","following_url":"https://api.github.com/users/sprockets/following{/other_user}","gists_url":"https://api.github.com/users/sprockets/gists{/gist_id}","starred_url":"https://api.github.com/users/sprockets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprockets/subscriptions","organizations_url":"https://api.github.com/users/sprockets/orgs","repos_url":"https://api.github.com/users/sprockets/repos","events_url":"https://api.github.com/users/sprockets/events{/privacy}","received_events_url":"https://api.github.com/users/sprockets/received_events","type":"Organization","site_admin":false},"repo":{"id":52723248,"name":"sprockets.clients.http","full_name":"sprockets/sprockets.clients.http","owner":{"login":"sprockets","id":8236802,"avatar_url":"https://avatars.githubusercontent.com/u/8236802?v=3","gravatar_id":"","url":"https://api.github.com/users/sprockets","html_url":"https://github.com/sprockets","followers_url":"https://api.github.com/users/sprockets/followers","following_url":"https://api.github.com/users/sprockets/following{/other_user}","gists_url":"https://api.github.com/users/sprockets/gists{/gist_id}","starred_url":"https://api.github.com/users/sprockets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprockets/subscriptions","organizations_url":"https://api.github.com/users/sprockets/orgs","repos_url":"https://api.github.com/users/sprockets/repos","events_url":"https://api.github.com/users/sprockets/events{/privacy}","received_events_url":"https://api.github.com/users/sprockets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sprockets/sprockets.clients.http","description":"","fork":false,"url":"https://api.github.com/repos/sprockets/sprockets.clients.http","forks_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/forks","keys_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/teams","hooks_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/hooks","issue_events_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/events{/number}","events_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/events","assignees_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/assignees{/user}","branches_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/branches{/branch}","tags_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/tags","blobs_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/refs{/sha}","trees_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/statuses/{sha}","languages_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/languages","stargazers_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/stargazers","contributors_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/contributors","subscribers_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/subscribers","subscription_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/subscription","commits_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/commits{/sha}","git_commits_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/git/commits{/sha}","comments_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/comments{/number}","issue_comment_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/comments{/number}","contents_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/contents/{+path}","compare_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/merges","archive_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/downloads","issues_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues{/number}","pulls_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls{/number}","milestones_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/milestones{/number}","notifications_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/labels{/name}","releases_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/releases{/id}","deployments_url":"https://api.github.com/repos/sprockets/sprockets.clients.http/deployments","created_at":"2016-02-28T13:47:29Z","updated_at":"2016-02-28T14:02:29Z","pushed_at":"2016-02-28T14:26:23Z","git_url":"git://github.com/sprockets/sprockets.clients.http.git","ssh_url":"git@github.com:sprockets/sprockets.clients.http.git","clone_url":"https://github.com/sprockets/sprockets.clients.http.git","svn_url":"https://github.com/sprockets/sprockets.clients.http","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/1"},"html":{"href":"https://github.com/sprockets/sprockets.clients.http/pull/1"},"issue":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/1"},"comments":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sprockets/sprockets.clients.http/statuses/31daef908d398ebf47dfa144436ea730c2fccfbb"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":19,"additions":602,"deletions":7,"changed_files":17}}