{"action":"created","comment":{"url":"https://api.github.com/repos/php-http/documentation/pulls/comments/45703654","id":45703654,"diff_hunk":"@@ -0,0 +1,113 @@\n+# HTTPlug HTTP client abstraction\n+\n+HTTPlug is an abstraction for HTTP clients. There are two main use cases:\n+\n+1. Usage in a project/application\n+2. Usage in a reusable package\n+\n+In both cases, the `Http\\Client\\HttpClient` provides a `sendRequest` method to send a PSR-7 `RequestInterface`\n+and returns a PSR-7 `ResponseInterface`or throws an exception that implements `Http\\Client\\Exception`.\n+\n+There is also the `Http\\Client\\HttpAsyncClient` which provides the `sendAsyncRequest` method to send\n+a request asynchronously and returns a `Http\\Client\\Promise`.\n+\n+It can be used later to retrieve a PSR-7 `ResponseInterface` or an exception that implements `Http\\Client\\Exception`.\n+\n+\n+<p class=\"text-warning\">\n+    Contract for the `Http\\Client\\Promise` is temporary until\n+    [PSR is released](https://groups.google.com/forum/?fromgroups#!topic/php-fig/wzQWpLvNSjs).\n+    Once it is out, we will use this PSR in the main client and deprecate the old contract.\n+</p>\n+\n+\n+See the [tutorial](tutorial.md) for a concrete example.\n+\n+\n+## HTTPlug implementations\n+\n+HTTPlug implementations typically are either HTTP clients of their own, or adapters wrapping existing clients\n+like Guzzle 6. In the latter case, they will depend on the required client implementation,\n+so you only need to require the adapter and not the actual client.\n+\n+\n+There are two kind of implementations:\n+\n+ - [php-http/client-implementation](https://packagist.org/providers/php-http/client-implementation):\n+ the synchronous implementation that waits for the response / error before returning from the `sendRequest` method.\n+ - [php-http/async-client-implementation](https://packagist.org/providers/php-http/async-client-implementation):\n+ the asynchronous implementation that immediately returns a `Http\\Client\\Promise`,\n+ allowing to send several requests in parallel and handling responses later.\n+\n+Check links above for the full list of implementations.\n+\n+<p class=\"text-warning\">\n+    Note: Until HTTPlug 1.0 becomes stable, we will focus on the Guzzle6 adapter.\n+</p>\n+\n+\n+## Usage in a project\n+\n+When writing an application, you need to require a concrete\n+[implementation](https://packagist.org/providers/php-http/client-implementation).\n+\n+See [virtual package](virtual-package.md) for more information on the topic of working with HTTPlug implementations.\n+\n+\n+## Installation in a reusable package\n+\n+In many cases, packages are designed to be reused from the very beginning.\n+For example, API clients are usually used in other packages/applications, not on their own.\n+\n+In these cases, they should **not rely on a concrete implementation** (like Guzzle 6),","path":"docs/httplug/index.md","position":62,"original_position":62,"commit_id":"bf2b8ea2316c9a48d2d7ccb43f20820a818bb282","original_commit_id":"bf2b8ea2316c9a48d2d7ccb43f20820a818bb282","user":{"login":"dbu","id":76576,"avatar_url":"https://avatars.githubusercontent.com/u/76576?v=3","gravatar_id":"","url":"https://api.github.com/users/dbu","html_url":"https://github.com/dbu","followers_url":"https://api.github.com/users/dbu/followers","following_url":"https://api.github.com/users/dbu/following{/other_user}","gists_url":"https://api.github.com/users/dbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbu/subscriptions","organizations_url":"https://api.github.com/users/dbu/orgs","repos_url":"https://api.github.com/users/dbu/repos","events_url":"https://api.github.com/users/dbu/events{/privacy}","received_events_url":"https://api.github.com/users/dbu/received_events","type":"User","site_admin":false},"body":"s/In these cases, they/Reusable packages/","created_at":"2015-11-24T07:31:56Z","updated_at":"2015-11-24T07:31:56Z","html_url":"https://github.com/php-http/documentation/pull/39#discussion_r45703654","pull_request_url":"https://api.github.com/repos/php-http/documentation/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/php-http/documentation/pulls/comments/45703654"},"html":{"href":"https://github.com/php-http/documentation/pull/39#discussion_r45703654"},"pull_request":{"href":"https://api.github.com/repos/php-http/documentation/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/php-http/documentation/pulls/39","id":51570930,"html_url":"https://github.com/php-http/documentation/pull/39","diff_url":"https://github.com/php-http/documentation/pull/39.diff","patch_url":"https://github.com/php-http/documentation/pull/39.patch","issue_url":"https://api.github.com/repos/php-http/documentation/issues/39","number":39,"state":"open","locked":false,"title":"Refactor","user":{"login":"sagikazarmark","id":1226384,"avatar_url":"https://avatars.githubusercontent.com/u/1226384?v=3","gravatar_id":"","url":"https://api.github.com/users/sagikazarmark","html_url":"https://github.com/sagikazarmark","followers_url":"https://api.github.com/users/sagikazarmark/followers","following_url":"https://api.github.com/users/sagikazarmark/following{/other_user}","gists_url":"https://api.github.com/users/sagikazarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/sagikazarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagikazarmark/subscriptions","organizations_url":"https://api.github.com/users/sagikazarmark/orgs","repos_url":"https://api.github.com/users/sagikazarmark/repos","events_url":"https://api.github.com/users/sagikazarmark/events{/privacy}","received_events_url":"https://api.github.com/users/sagikazarmark/received_events","type":"User","site_admin":false},"body":"Things worth to mention:\r\n\r\n- Removed the package overview page. We should readd it at some point if it is necessary, but from the refactoring point of view I just couldn't place it anywhere.\r\n- Moved all HTTPlug related stuff under the HTTPlug group\r\n- Moved all other stuff under the Components group\r\n- Line character limits\r\n- Added some text to the index\r\n\r\nPlease review as I cannot read any more docs and I am sure it is full of mistakes.","created_at":"2015-11-23T19:49:49Z","updated_at":"2015-11-24T07:31:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f5316cd3c8f09fbf92d4db3e7c1dd360d3c4578","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php-http/documentation/pulls/39/commits","review_comments_url":"https://api.github.com/repos/php-http/documentation/pulls/39/comments","review_comment_url":"https://api.github.com/repos/php-http/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-http/documentation/issues/39/comments","statuses_url":"https://api.github.com/repos/php-http/documentation/statuses/bf2b8ea2316c9a48d2d7ccb43f20820a818bb282","head":{"label":"php-http:refactor","ref":"refactor","sha":"bf2b8ea2316c9a48d2d7ccb43f20820a818bb282","user":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":37063526,"name":"documentation","full_name":"php-http/documentation","owner":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-http/documentation","description":"This is the documentation repository of the HTTP Adapter software components","fork":false,"url":"https://api.github.com/repos/php-http/documentation","forks_url":"https://api.github.com/repos/php-http/documentation/forks","keys_url":"https://api.github.com/repos/php-http/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/documentation/teams","hooks_url":"https://api.github.com/repos/php-http/documentation/hooks","issue_events_url":"https://api.github.com/repos/php-http/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/documentation/events","assignees_url":"https://api.github.com/repos/php-http/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/documentation/tags","blobs_url":"https://api.github.com/repos/php-http/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/documentation/languages","stargazers_url":"https://api.github.com/repos/php-http/documentation/stargazers","contributors_url":"https://api.github.com/repos/php-http/documentation/contributors","subscribers_url":"https://api.github.com/repos/php-http/documentation/subscribers","subscription_url":"https://api.github.com/repos/php-http/documentation/subscription","commits_url":"https://api.github.com/repos/php-http/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/documentation/merges","archive_url":"https://api.github.com/repos/php-http/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/documentation/downloads","issues_url":"https://api.github.com/repos/php-http/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/documentation/labels{/name}","releases_url":"https://api.github.com/repos/php-http/documentation/releases{/id}","created_at":"2015-06-08T11:44:22Z","updated_at":"2015-10-23T17:23:40Z","pushed_at":"2015-11-23T19:49:49Z","git_url":"git://github.com/php-http/documentation.git","ssh_url":"git@github.com:php-http/documentation.git","clone_url":"https://github.com/php-http/documentation.git","svn_url":"https://github.com/php-http/documentation","homepage":"http://php-http.org","size":52,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":12,"forks":5,"open_issues":12,"watchers":1,"default_branch":"master"}},"base":{"label":"php-http:master","ref":"master","sha":"f4072ba7811e71f34a897098d46b9685544b75b0","user":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"repo":{"id":37063526,"name":"documentation","full_name":"php-http/documentation","owner":{"login":"php-http","id":12104859,"avatar_url":"https://avatars.githubusercontent.com/u/12104859?v=3","gravatar_id":"","url":"https://api.github.com/users/php-http","html_url":"https://github.com/php-http","followers_url":"https://api.github.com/users/php-http/followers","following_url":"https://api.github.com/users/php-http/following{/other_user}","gists_url":"https://api.github.com/users/php-http/gists{/gist_id}","starred_url":"https://api.github.com/users/php-http/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-http/subscriptions","organizations_url":"https://api.github.com/users/php-http/orgs","repos_url":"https://api.github.com/users/php-http/repos","events_url":"https://api.github.com/users/php-http/events{/privacy}","received_events_url":"https://api.github.com/users/php-http/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-http/documentation","description":"This is the documentation repository of the HTTP Adapter software components","fork":false,"url":"https://api.github.com/repos/php-http/documentation","forks_url":"https://api.github.com/repos/php-http/documentation/forks","keys_url":"https://api.github.com/repos/php-http/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-http/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-http/documentation/teams","hooks_url":"https://api.github.com/repos/php-http/documentation/hooks","issue_events_url":"https://api.github.com/repos/php-http/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/php-http/documentation/events","assignees_url":"https://api.github.com/repos/php-http/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/php-http/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/php-http/documentation/tags","blobs_url":"https://api.github.com/repos/php-http/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-http/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-http/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-http/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-http/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/php-http/documentation/languages","stargazers_url":"https://api.github.com/repos/php-http/documentation/stargazers","contributors_url":"https://api.github.com/repos/php-http/documentation/contributors","subscribers_url":"https://api.github.com/repos/php-http/documentation/subscribers","subscription_url":"https://api.github.com/repos/php-http/documentation/subscription","commits_url":"https://api.github.com/repos/php-http/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-http/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-http/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-http/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-http/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/php-http/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-http/documentation/merges","archive_url":"https://api.github.com/repos/php-http/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-http/documentation/downloads","issues_url":"https://api.github.com/repos/php-http/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/php-http/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/php-http/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/php-http/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-http/documentation/labels{/name}","releases_url":"https://api.github.com/repos/php-http/documentation/releases{/id}","created_at":"2015-06-08T11:44:22Z","updated_at":"2015-10-23T17:23:40Z","pushed_at":"2015-11-23T19:49:49Z","git_url":"git://github.com/php-http/documentation.git","ssh_url":"git@github.com:php-http/documentation.git","clone_url":"https://github.com/php-http/documentation.git","svn_url":"https://github.com/php-http/documentation","homepage":"http://php-http.org","size":52,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":12,"forks":5,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-http/documentation/pulls/39"},"html":{"href":"https://github.com/php-http/documentation/pull/39"},"issue":{"href":"https://api.github.com/repos/php-http/documentation/issues/39"},"comments":{"href":"https://api.github.com/repos/php-http/documentation/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/php-http/documentation/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/php-http/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-http/documentation/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/php-http/documentation/statuses/bf2b8ea2316c9a48d2d7ccb43f20820a818bb282"}}}}