{"action":"created","comment":{"url":"https://api.github.com/repos/octokit/octokit.net/pulls/comments/22695695","id":22695695,"diff_hunk":"@@ -140,7 +137,7 @@ protected virtual HttpRequestMessage BuildRequestMessage(IRequest request)\n             return requestMessage;\n         }\n \n-        static string GetContentType(HttpContent httpContent)\n+        static string GetContentMediaTypeType(HttpContent httpContent)","path":"Octokit/Http/HttpClientAdapter.cs","position":106,"original_position":106,"commit_id":"fa363b169f06130a70cc35c4d0e0aa3cf8edc902","original_commit_id":"fa363b169f06130a70cc35c4d0e0aa3cf8edc902","user":{"login":"shiftkey","id":359239,"avatar_url":"https://avatars.githubusercontent.com/u/359239?v=3","gravatar_id":"","url":"https://api.github.com/users/shiftkey","html_url":"https://github.com/shiftkey","followers_url":"https://api.github.com/users/shiftkey/followers","following_url":"https://api.github.com/users/shiftkey/following{/other_user}","gists_url":"https://api.github.com/users/shiftkey/gists{/gist_id}","starred_url":"https://api.github.com/users/shiftkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiftkey/subscriptions","organizations_url":"https://api.github.com/users/shiftkey/orgs","repos_url":"https://api.github.com/users/shiftkey/repos","events_url":"https://api.github.com/users/shiftkey/events{/privacy}","received_events_url":"https://api.github.com/users/shiftkey/received_events","type":"User","site_admin":true},"body":"Is `MediaTypeType` necessary here, or just a refactoring mistype?","created_at":"2015-01-09T00:54:37Z","updated_at":"2015-01-09T00:54:37Z","html_url":"https://github.com/octokit/octokit.net/pull/662#discussion_r22695695","pull_request_url":"https://api.github.com/repos/octokit/octokit.net/pulls/662","_links":{"self":{"href":"https://api.github.com/repos/octokit/octokit.net/pulls/comments/22695695"},"html":{"href":"https://github.com/octokit/octokit.net/pull/662#discussion_r22695695"},"pull_request":{"href":"https://api.github.com/repos/octokit/octokit.net/pulls/662"}}},"pull_request":{"url":"https://api.github.com/repos/octokit/octokit.net/pulls/662","id":26804893,"html_url":"https://github.com/octokit/octokit.net/pull/662","diff_url":"https://github.com/octokit/octokit.net/pull/662.diff","patch_url":"https://github.com/octokit/octokit.net/pull/662.patch","issue_url":"https://api.github.com/repos/octokit/octokit.net/issues/662","number":662,"state":"open","locked":false,"title":"Make the response objects readonly.","user":{"login":"Haacked","id":19977,"avatar_url":"https://avatars.githubusercontent.com/u/19977?v=3","gravatar_id":"","url":"https://api.github.com/users/Haacked","html_url":"https://github.com/Haacked","followers_url":"https://api.github.com/users/Haacked/followers","following_url":"https://api.github.com/users/Haacked/following{/other_user}","gists_url":"https://api.github.com/users/Haacked/gists{/gist_id}","starred_url":"https://api.github.com/users/Haacked/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Haacked/subscriptions","organizations_url":"https://api.github.com/users/Haacked/orgs","repos_url":"https://api.github.com/users/Haacked/repos","events_url":"https://api.github.com/users/Haacked/events{/privacy}","received_events_url":"https://api.github.com/users/Haacked/received_events","type":"User","site_admin":true},"body":":warning: BREAKING CHANGE ALERT! :warning: \r\n\r\nOne of the haacks we've had in the API design is that `IResponse` was not a readonly interface. We made the `BodyAsObject` property settable. The reason was it made it convenient to separate the creation of the response from the deserialization.\r\n\r\nBut in thinking about this, I think the proper approach to that is not to mutate the response object, but to wrap it with another object that accepts the deserialized type (look at how the `Connection.Run<T>` method changes as well as `JsonHttpPipeline` object).\r\n\r\nSo in this PR, I went all out and we have a `Response` object that's pretty simple. And we have a separate `ApiResponse<T>` object that has two properties, the deserialized `Body` and the original `IResponse`. So `IHttpClient.Send` just returns a `IResponse` and we then deserialize the body and wrap both things in `ApiResponse<T>`.\r\n\r\nAn alternative approach I considered is to simplify this by getting rid of `IResponse` altogether and only having an `ApiResponse<T>`. However that means that any implementations of `IHttpClient` would be responsible not only for creating a response, but deserializing it. With the current implementation, an implementation of `IHttpClient` doesn't have to worry about deserialization. It's handled separately.\r\n\r\nThoughts?","created_at":"2015-01-05T03:31:03Z","updated_at":"2015-01-09T00:54:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba33ce7267e97180bd4315c749cb669dcf7d3a01","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/octokit/octokit.net/pulls/662/commits","review_comments_url":"https://api.github.com/repos/octokit/octokit.net/pulls/662/comments","review_comment_url":"https://api.github.com/repos/octokit/octokit.net/pulls/comments/{number}","comments_url":"https://api.github.com/repos/octokit/octokit.net/issues/662/comments","statuses_url":"https://api.github.com/repos/octokit/octokit.net/statuses/fa363b169f06130a70cc35c4d0e0aa3cf8edc902","head":{"label":"octokit:haacked/api-response-refactor","ref":"haacked/api-response-refactor","sha":"fa363b169f06130a70cc35c4d0e0aa3cf8edc902","user":{"login":"octokit","id":3430433,"avatar_url":"https://avatars.githubusercontent.com/u/3430433?v=3","gravatar_id":"","url":"https://api.github.com/users/octokit","html_url":"https://github.com/octokit","followers_url":"https://api.github.com/users/octokit/followers","following_url":"https://api.github.com/users/octokit/following{/other_user}","gists_url":"https://api.github.com/users/octokit/gists{/gist_id}","starred_url":"https://api.github.com/users/octokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octokit/subscriptions","organizations_url":"https://api.github.com/users/octokit/orgs","repos_url":"https://api.github.com/users/octokit/repos","events_url":"https://api.github.com/users/octokit/events{/privacy}","received_events_url":"https://api.github.com/users/octokit/received_events","type":"Organization","site_admin":false},"repo":{"id":7528679,"name":"octokit.net","full_name":"octokit/octokit.net","owner":{"login":"octokit","id":3430433,"avatar_url":"https://avatars.githubusercontent.com/u/3430433?v=3","gravatar_id":"","url":"https://api.github.com/users/octokit","html_url":"https://github.com/octokit","followers_url":"https://api.github.com/users/octokit/followers","following_url":"https://api.github.com/users/octokit/following{/other_user}","gists_url":"https://api.github.com/users/octokit/gists{/gist_id}","starred_url":"https://api.github.com/users/octokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octokit/subscriptions","organizations_url":"https://api.github.com/users/octokit/orgs","repos_url":"https://api.github.com/users/octokit/repos","events_url":"https://api.github.com/users/octokit/events{/privacy}","received_events_url":"https://api.github.com/users/octokit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/octokit/octokit.net","description":"A GitHub API client library for .NET ","fork":false,"url":"https://api.github.com/repos/octokit/octokit.net","forks_url":"https://api.github.com/repos/octokit/octokit.net/forks","keys_url":"https://api.github.com/repos/octokit/octokit.net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octokit/octokit.net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octokit/octokit.net/teams","hooks_url":"https://api.github.com/repos/octokit/octokit.net/hooks","issue_events_url":"https://api.github.com/repos/octokit/octokit.net/issues/events{/number}","events_url":"https://api.github.com/repos/octokit/octokit.net/events","assignees_url":"https://api.github.com/repos/octokit/octokit.net/assignees{/user}","branches_url":"https://api.github.com/repos/octokit/octokit.net/branches{/branch}","tags_url":"https://api.github.com/repos/octokit/octokit.net/tags","blobs_url":"https://api.github.com/repos/octokit/octokit.net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octokit/octokit.net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octokit/octokit.net/git/refs{/sha}","trees_url":"https://api.github.com/repos/octokit/octokit.net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octokit/octokit.net/statuses/{sha}","languages_url":"https://api.github.com/repos/octokit/octokit.net/languages","stargazers_url":"https://api.github.com/repos/octokit/octokit.net/stargazers","contributors_url":"https://api.github.com/repos/octokit/octokit.net/contributors","subscribers_url":"https://api.github.com/repos/octokit/octokit.net/subscribers","subscription_url":"https://api.github.com/repos/octokit/octokit.net/subscription","commits_url":"https://api.github.com/repos/octokit/octokit.net/commits{/sha}","git_commits_url":"https://api.github.com/repos/octokit/octokit.net/git/commits{/sha}","comments_url":"https://api.github.com/repos/octokit/octokit.net/comments{/number}","issue_comment_url":"https://api.github.com/repos/octokit/octokit.net/issues/comments/{number}","contents_url":"https://api.github.com/repos/octokit/octokit.net/contents/{+path}","compare_url":"https://api.github.com/repos/octokit/octokit.net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octokit/octokit.net/merges","archive_url":"https://api.github.com/repos/octokit/octokit.net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octokit/octokit.net/downloads","issues_url":"https://api.github.com/repos/octokit/octokit.net/issues{/number}","pulls_url":"https://api.github.com/repos/octokit/octokit.net/pulls{/number}","milestones_url":"https://api.github.com/repos/octokit/octokit.net/milestones{/number}","notifications_url":"https://api.github.com/repos/octokit/octokit.net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octokit/octokit.net/labels{/name}","releases_url":"https://api.github.com/repos/octokit/octokit.net/releases{/id}","created_at":"2013-01-09T20:48:45Z","updated_at":"2015-01-05T11:13:10Z","pushed_at":"2015-01-05T11:13:10Z","git_url":"git://github.com/octokit/octokit.net.git","ssh_url":"git@github.com:octokit/octokit.net.git","clone_url":"https://github.com/octokit/octokit.net.git","svn_url":"https://github.com/octokit/octokit.net","homepage":null,"size":63266,"stargazers_count":571,"watchers_count":571,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":232,"mirror_url":null,"open_issues_count":68,"forks":232,"open_issues":68,"watchers":571,"default_branch":"master"}},"base":{"label":"octokit:master","ref":"master","sha":"974bbba4e2d4985d186225d9f33267e452dac291","user":{"login":"octokit","id":3430433,"avatar_url":"https://avatars.githubusercontent.com/u/3430433?v=3","gravatar_id":"","url":"https://api.github.com/users/octokit","html_url":"https://github.com/octokit","followers_url":"https://api.github.com/users/octokit/followers","following_url":"https://api.github.com/users/octokit/following{/other_user}","gists_url":"https://api.github.com/users/octokit/gists{/gist_id}","starred_url":"https://api.github.com/users/octokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octokit/subscriptions","organizations_url":"https://api.github.com/users/octokit/orgs","repos_url":"https://api.github.com/users/octokit/repos","events_url":"https://api.github.com/users/octokit/events{/privacy}","received_events_url":"https://api.github.com/users/octokit/received_events","type":"Organization","site_admin":false},"repo":{"id":7528679,"name":"octokit.net","full_name":"octokit/octokit.net","owner":{"login":"octokit","id":3430433,"avatar_url":"https://avatars.githubusercontent.com/u/3430433?v=3","gravatar_id":"","url":"https://api.github.com/users/octokit","html_url":"https://github.com/octokit","followers_url":"https://api.github.com/users/octokit/followers","following_url":"https://api.github.com/users/octokit/following{/other_user}","gists_url":"https://api.github.com/users/octokit/gists{/gist_id}","starred_url":"https://api.github.com/users/octokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octokit/subscriptions","organizations_url":"https://api.github.com/users/octokit/orgs","repos_url":"https://api.github.com/users/octokit/repos","events_url":"https://api.github.com/users/octokit/events{/privacy}","received_events_url":"https://api.github.com/users/octokit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/octokit/octokit.net","description":"A GitHub API client library for .NET ","fork":false,"url":"https://api.github.com/repos/octokit/octokit.net","forks_url":"https://api.github.com/repos/octokit/octokit.net/forks","keys_url":"https://api.github.com/repos/octokit/octokit.net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octokit/octokit.net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octokit/octokit.net/teams","hooks_url":"https://api.github.com/repos/octokit/octokit.net/hooks","issue_events_url":"https://api.github.com/repos/octokit/octokit.net/issues/events{/number}","events_url":"https://api.github.com/repos/octokit/octokit.net/events","assignees_url":"https://api.github.com/repos/octokit/octokit.net/assignees{/user}","branches_url":"https://api.github.com/repos/octokit/octokit.net/branches{/branch}","tags_url":"https://api.github.com/repos/octokit/octokit.net/tags","blobs_url":"https://api.github.com/repos/octokit/octokit.net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octokit/octokit.net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octokit/octokit.net/git/refs{/sha}","trees_url":"https://api.github.com/repos/octokit/octokit.net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octokit/octokit.net/statuses/{sha}","languages_url":"https://api.github.com/repos/octokit/octokit.net/languages","stargazers_url":"https://api.github.com/repos/octokit/octokit.net/stargazers","contributors_url":"https://api.github.com/repos/octokit/octokit.net/contributors","subscribers_url":"https://api.github.com/repos/octokit/octokit.net/subscribers","subscription_url":"https://api.github.com/repos/octokit/octokit.net/subscription","commits_url":"https://api.github.com/repos/octokit/octokit.net/commits{/sha}","git_commits_url":"https://api.github.com/repos/octokit/octokit.net/git/commits{/sha}","comments_url":"https://api.github.com/repos/octokit/octokit.net/comments{/number}","issue_comment_url":"https://api.github.com/repos/octokit/octokit.net/issues/comments/{number}","contents_url":"https://api.github.com/repos/octokit/octokit.net/contents/{+path}","compare_url":"https://api.github.com/repos/octokit/octokit.net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octokit/octokit.net/merges","archive_url":"https://api.github.com/repos/octokit/octokit.net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octokit/octokit.net/downloads","issues_url":"https://api.github.com/repos/octokit/octokit.net/issues{/number}","pulls_url":"https://api.github.com/repos/octokit/octokit.net/pulls{/number}","milestones_url":"https://api.github.com/repos/octokit/octokit.net/milestones{/number}","notifications_url":"https://api.github.com/repos/octokit/octokit.net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octokit/octokit.net/labels{/name}","releases_url":"https://api.github.com/repos/octokit/octokit.net/releases{/id}","created_at":"2013-01-09T20:48:45Z","updated_at":"2015-01-05T11:13:10Z","pushed_at":"2015-01-05T11:13:10Z","git_url":"git://github.com/octokit/octokit.net.git","ssh_url":"git@github.com:octokit/octokit.net.git","clone_url":"https://github.com/octokit/octokit.net.git","svn_url":"https://github.com/octokit/octokit.net","homepage":null,"size":63266,"stargazers_count":571,"watchers_count":571,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":232,"mirror_url":null,"open_issues_count":68,"forks":232,"open_issues":68,"watchers":571,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/octokit/octokit.net/pulls/662"},"html":{"href":"https://github.com/octokit/octokit.net/pull/662"},"issue":{"href":"https://api.github.com/repos/octokit/octokit.net/issues/662"},"comments":{"href":"https://api.github.com/repos/octokit/octokit.net/issues/662/comments"},"review_comments":{"href":"https://api.github.com/repos/octokit/octokit.net/pulls/662/comments"},"review_comment":{"href":"https://api.github.com/repos/octokit/octokit.net/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/octokit/octokit.net/pulls/662/commits"},"statuses":{"href":"https://api.github.com/repos/octokit/octokit.net/statuses/fa363b169f06130a70cc35c4d0e0aa3cf8edc902"}}}}