{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular/pulls/comments/32570172","id":32570172,"diff_hunk":"@@ -1,51 +1,144 @@\n /// <reference path=\"../../typings/rx/rx.all.d.ts\" />\n \n import {Injectable} from 'angular2/src/di/decorators';\n-import {RequestOptions, Connection} from './interfaces';\n+import {IRequestOptions, Connection} from './interfaces';\n import {Request} from './static_request';\n import {Response} from './static_response';\n import {XHRBackend} from './backends/xhr_backend';\n import {BaseRequestOptions} from './base_request_options';\n+import {RequestMethods} from './enums';\n+import {URLSearchParams} from './url_search_params';\n import * as Rx from 'rx';\n \n+function httpRequest(backend: XHRBackend, request: Request) {\n+  return <Rx.Observable<Response>>(Observable.create(observer => {\n+    var connection: Connection = backend.createConnection(request);\n+    var internalSubscription = connection.response.subscribe(observer);\n+    return () => {\n+      internalSubscription.dispose();\n+      connection.dispose();\n+    }\n+  }))\n+}\n+\n /**\n- * A function to perform http requests over XMLHttpRequest.\n+ * Performs http requests using `XMLHttpRequest`.\n+ *\n+ * `Http` is available as an injectable class, with methods to perform http requests. Calling\n+ *`request` returns an\n+ *[Observable](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/observable.md),","path":"modules/angular2/src/http/http.ts","position":31,"original_position":31,"commit_id":"a5298d134050e17d9a18f879103a1052b9d0114c","original_commit_id":"a5298d134050e17d9a18f879103a1052b9d0114c","user":{"login":"alxhub","id":4175141,"avatar_url":"https://avatars.githubusercontent.com/u/4175141?v=3","gravatar_id":"","url":"https://api.github.com/users/alxhub","html_url":"https://github.com/alxhub","followers_url":"https://api.github.com/users/alxhub/followers","following_url":"https://api.github.com/users/alxhub/following{/other_user}","gists_url":"https://api.github.com/users/alxhub/gists{/gist_id}","starred_url":"https://api.github.com/users/alxhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxhub/subscriptions","organizations_url":"https://api.github.com/users/alxhub/orgs","repos_url":"https://api.github.com/users/alxhub/repos","events_url":"https://api.github.com/users/alxhub/events{/privacy}","received_events_url":"https://api.github.com/users/alxhub/received_events","type":"User","site_admin":false},"body":"Spaces after the *s in this block.","created_at":"2015-06-16T21:00:54Z","updated_at":"2015-06-16T21:00:54Z","html_url":"https://github.com/angular/angular/pull/2540#discussion_r32570172","pull_request_url":"https://api.github.com/repos/angular/angular/pulls/2540","_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/comments/32570172"},"html":{"href":"https://github.com/angular/angular/pull/2540#discussion_r32570172"},"pull_request":{"href":"https://api.github.com/repos/angular/angular/pulls/2540"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/2540","id":37632768,"html_url":"https://github.com/angular/angular/pull/2540","diff_url":"https://github.com/angular/angular/pull/2540.diff","patch_url":"https://github.com/angular/angular/pull/2540.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/2540","number":2540,"state":"open","locked":false,"title":"Http refactor","user":{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false},"body":"TODOs:\r\n\r\n - [x] Add method descriptions for MockBackend\r\n - [x] Add member docs on Request Class\r\n - [x] Add docs to Response class\r\n - [x] Mark private members with an underscore to prevent from showing up in docs.\r\n - [x] Check that binding example would actually work in XHRBackend example (and determine simplest way to accomplish mocking)\r\n - [x] Add docs at the top-level http module\r\n - [x] Add docs to BaseRequestOptions and RequestOptions\r\n - [x] Simplify http example to not use pipe+assign-local","created_at":"2015-06-13T22:50:10Z","updated_at":"2015-06-16T21:00:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2581ca58685b1352a24105d8b2d767d063fba314","assignee":{"login":"alxhub","id":4175141,"avatar_url":"https://avatars.githubusercontent.com/u/4175141?v=3","gravatar_id":"","url":"https://api.github.com/users/alxhub","html_url":"https://github.com/alxhub","followers_url":"https://api.github.com/users/alxhub/followers","following_url":"https://api.github.com/users/alxhub/following{/other_user}","gists_url":"https://api.github.com/users/alxhub/gists{/gist_id}","starred_url":"https://api.github.com/users/alxhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxhub/subscriptions","organizations_url":"https://api.github.com/users/alxhub/orgs","repos_url":"https://api.github.com/users/alxhub/repos","events_url":"https://api.github.com/users/alxhub/events{/privacy}","received_events_url":"https://api.github.com/users/alxhub/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/36","html_url":"https://github.com/angular/angular/milestones/alpha-28","labels_url":"https://api.github.com/repos/angular/angular/milestones/36/labels","id":1140762,"number":36,"title":"alpha-28","description":"Next milestone. Work on all issues to complete by Monday June 22 @ 8am PT; sync internal/external by 24th.","creator":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"open_issues":48,"closed_issues":16,"state":"open","created_at":"2015-05-29T21:53:22Z","updated_at":"2015-06-16T20:31:32Z","due_on":"2015-06-22T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular/pulls/2540/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/2540/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/2540/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/a5298d134050e17d9a18f879103a1052b9d0114c","head":{"label":"jeffbcross:http-refactor","ref":"http-refactor","sha":"a5298d134050e17d9a18f879103a1052b9d0114c","user":{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false},"repo":{"id":26875035,"name":"angular","full_name":"jeffbcross/angular","owner":{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeffbcross/angular","description":"","fork":true,"url":"https://api.github.com/repos/jeffbcross/angular","forks_url":"https://api.github.com/repos/jeffbcross/angular/forks","keys_url":"https://api.github.com/repos/jeffbcross/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeffbcross/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeffbcross/angular/teams","hooks_url":"https://api.github.com/repos/jeffbcross/angular/hooks","issue_events_url":"https://api.github.com/repos/jeffbcross/angular/issues/events{/number}","events_url":"https://api.github.com/repos/jeffbcross/angular/events","assignees_url":"https://api.github.com/repos/jeffbcross/angular/assignees{/user}","branches_url":"https://api.github.com/repos/jeffbcross/angular/branches{/branch}","tags_url":"https://api.github.com/repos/jeffbcross/angular/tags","blobs_url":"https://api.github.com/repos/jeffbcross/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeffbcross/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeffbcross/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeffbcross/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeffbcross/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/jeffbcross/angular/languages","stargazers_url":"https://api.github.com/repos/jeffbcross/angular/stargazers","contributors_url":"https://api.github.com/repos/jeffbcross/angular/contributors","subscribers_url":"https://api.github.com/repos/jeffbcross/angular/subscribers","subscription_url":"https://api.github.com/repos/jeffbcross/angular/subscription","commits_url":"https://api.github.com/repos/jeffbcross/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeffbcross/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeffbcross/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeffbcross/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeffbcross/angular/contents/{+path}","compare_url":"https://api.github.com/repos/jeffbcross/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeffbcross/angular/merges","archive_url":"https://api.github.com/repos/jeffbcross/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeffbcross/angular/downloads","issues_url":"https://api.github.com/repos/jeffbcross/angular/issues{/number}","pulls_url":"https://api.github.com/repos/jeffbcross/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/jeffbcross/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/jeffbcross/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeffbcross/angular/labels{/name}","releases_url":"https://api.github.com/repos/jeffbcross/angular/releases{/id}","created_at":"2014-11-19T18:22:08Z","updated_at":"2014-11-19T18:22:08Z","pushed_at":"2015-06-16T20:30:18Z","git_url":"git://github.com/jeffbcross/angular.git","ssh_url":"git@github.com:jeffbcross/angular.git","clone_url":"https://github.com/jeffbcross/angular.git","svn_url":"https://github.com/jeffbcross/angular","homepage":null,"size":8701,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"598a75ec1c837376b95adb3924a116531eec9d08","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":24195339,"name":"angular","full_name":"angular/angular","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular","description":"","fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","created_at":"2014-09-18T16:12:01Z","updated_at":"2015-06-16T19:50:21Z","pushed_at":"2015-06-16T20:34:44Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":null,"size":29811,"stargazers_count":3666,"watchers_count":3666,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":930,"mirror_url":null,"open_issues_count":304,"forks":930,"open_issues":304,"watchers":3666,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/2540"},"html":{"href":"https://github.com/angular/angular/pull/2540"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/2540"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/2540/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/2540/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/2540/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/a5298d134050e17d9a18f879103a1052b9d0114c"}}}}