{"action":"created","comment":{"url":"https://api.github.com/repos/php-http/documentation/pulls/comments/50673664","id":50673664,"diff_hunk":"@@ -1,4 +1,30 @@\n Decoder Plugin\n ==============\n \n-TODO\n+The `DecoderPlugin` decodes the body of the response with filters coming from the `Transfer-Encoding` or `Content-Encoding`\n+headers::\n+\n+    use Http\\Discovery\\HttpClientDiscovery;\n+    use Http\\Client\\Plugin\\PluginClient;\n+    use Http\\Client\\Plugin\\DecoderPlugin;\n+\n+    $decoderPlugin = new DecoderPlugin();\n+\n+    $pluginClient = new PluginClient(\n+        HttpClientDiscovery::find(),\n+        [$decoderPlugin]\n+    );\n+\n+The plugin can handle the following encodings:\n+\n+ * `chunked`: Decode a stream with a `chunked` encoding (no size in the `Content-Length` header of the response)\n+ * `compress`: Decode a stream encoded with the `compress` encoding according to :rfc:`1950`\n+ * `deflate`: Decode a stream encoded with the `inflate` encoding according to :rfc:`1951`\n+ * `gzip`: Decode a stream encoded with the `gzip` encoding according to :rfc:`1952`\n+\n+You can also use the decoder plugin to decode only the `Transfer-Encoding` header and not the `Content-Encoding` one\n+by setting the first parameter of the constructor to false::","path":"plugins/decoder.rst","position":27,"original_position":27,"commit_id":"a63b9bbaa568d1fdccdba0110e163a7a6033d978","original_commit_id":"a63b9bbaa568d1fdccdba0110e163a7a6033d978","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":"... by setting the ``use_content_encoding`` configuration option to ``false``::","created_at":"2016-01-25T10:01:25Z","updated_at":"2016-01-25T10:01:25Z","html_url":"https://github.com/php-http/documentation/pull/76#discussion_r50673664","pull_request_url":"https://api.github.com/repos/php-http/documentation/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/php-http/documentation/pulls/comments/50673664"},"html":{"href":"https://github.com/php-http/documentation/pull/76#discussion_r50673664"},"pull_request":{"href":"https://api.github.com/repos/php-http/documentation/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/php-http/documentation/pulls/76","id":56282262,"html_url":"https://github.com/php-http/documentation/pull/76","diff_url":"https://github.com/php-http/documentation/pull/76.diff","patch_url":"https://github.com/php-http/documentation/pull/76.patch","issue_url":"https://api.github.com/repos/php-http/documentation/issues/76","number":76,"state":"open","locked":false,"title":"[WIP] Feature/plugins doc","user":{"login":"joelwurtz","id":90466,"avatar_url":"https://avatars.githubusercontent.com/u/90466?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwurtz","html_url":"https://github.com/joelwurtz","followers_url":"https://api.github.com/users/joelwurtz/followers","following_url":"https://api.github.com/users/joelwurtz/following{/other_user}","gists_url":"https://api.github.com/users/joelwurtz/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwurtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwurtz/subscriptions","organizations_url":"https://api.github.com/users/joelwurtz/orgs","repos_url":"https://api.github.com/users/joelwurtz/repos","events_url":"https://api.github.com/users/joelwurtz/events{/privacy}","received_events_url":"https://api.github.com/users/joelwurtz/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-17T17:12:01Z","updated_at":"2016-01-25T10:01:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eedd64da702c72f5a038b5faf793d76bed1e6ccc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php-http/documentation/pulls/76/commits","review_comments_url":"https://api.github.com/repos/php-http/documentation/pulls/76/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/76/comments","statuses_url":"https://api.github.com/repos/php-http/documentation/statuses/a63b9bbaa568d1fdccdba0110e163a7a6033d978","head":{"label":"php-http:feature/plugins-doc","ref":"feature/plugins-doc","sha":"a63b9bbaa568d1fdccdba0110e163a7a6033d978","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":"Documentation for PHP-HTTP including HTTPlug","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}","deployments_url":"https://api.github.com/repos/php-http/documentation/deployments","created_at":"2015-06-08T11:44:22Z","updated_at":"2016-01-04T21:37:44Z","pushed_at":"2016-01-23T14:09:45Z","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://docs.php-http.org","size":147,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":1,"default_branch":"master"}},"base":{"label":"php-http:master","ref":"master","sha":"1989a3dc816e7fc064606917acdd5fc4452cc298","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":"Documentation for PHP-HTTP including HTTPlug","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}","deployments_url":"https://api.github.com/repos/php-http/documentation/deployments","created_at":"2015-06-08T11:44:22Z","updated_at":"2016-01-04T21:37:44Z","pushed_at":"2016-01-23T14:09:45Z","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://docs.php-http.org","size":147,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-http/documentation/pulls/76"},"html":{"href":"https://github.com/php-http/documentation/pull/76"},"issue":{"href":"https://api.github.com/repos/php-http/documentation/issues/76"},"comments":{"href":"https://api.github.com/repos/php-http/documentation/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/php-http/documentation/pulls/76/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/76/commits"},"statuses":{"href":"https://api.github.com/repos/php-http/documentation/statuses/a63b9bbaa568d1fdccdba0110e163a7a6033d978"}}}}