{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/79681872","id":79681872,"diff_hunk":"@@ -48,11 +67,186 @@ public partial interface IWebRequestCreate\n     {\n         System.Net.WebRequest Create(System.Uri uri);\n     }\n+    public delegate void OpenReadCompletedEventHandler(object sender, System.Net.OpenReadCompletedEventArgs e);\n+    public class OpenReadCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs\n+    {\n+        internal OpenReadCompletedEventArgs(System.IO.Stream result, System.Exception exception, bool cancelled, object userToken) : base(exception, cancelled, userToken) { }\n+        public System.IO.Stream Result { get { throw null; } }\n+    }\n+    public delegate void OpenWriteCompletedEventHandler(object sender, System.Net.OpenWriteCompletedEventArgs e);\n+    public class OpenWriteCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs\n+    {\n+        internal OpenWriteCompletedEventArgs(System.IO.Stream result, System.Exception exception, bool cancelled, object userToken) : base(exception, cancelled, userToken) { }\n+        public System.IO.Stream Result { get { throw null; } }\n+    }\n     public partial class ProtocolViolationException : System.InvalidOperationException\n     {\n         public ProtocolViolationException() { }\n         public ProtocolViolationException(string message) { }\n     }\n+    public class UploadDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs\n+    {\n+        internal UploadDataCompletedEventArgs(byte[] result, System.Exception exception, bool cancelled, object userToken) : base(exception, cancelled, userToken) { }\n+        public byte[] Result { get { throw null; } }\n+    }\n+    public delegate void UploadDataCompletedEventHandler(object sender, System.Net.UploadDataCompletedEventArgs e);\n+    public class UploadFileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs\n+    {\n+        internal UploadFileCompletedEventArgs(byte[] result, System.Exception exception, bool cancelled, object userToken) : base(exception, cancelled, userToken) { }\n+        public byte[] Result { get { throw null; } }\n+    }\n+    public delegate void UploadFileCompletedEventHandler(object sender, System.Net.UploadFileCompletedEventArgs e);\n+    public class UploadProgressChangedEventArgs : System.ComponentModel.ProgressChangedEventArgs\n+    {\n+        internal UploadProgressChangedEventArgs(int progressPercentage, object userToken, long bytesSent, long totalBytesToSend, long bytesReceived, long totalBytesToReceive) : base(progressPercentage, userToken) { }\n+        public long BytesReceived { get { throw null; } }\n+        public long TotalBytesToReceive { get { throw null; } }\n+        public long BytesSent { get { throw null; } }\n+        public long TotalBytesToSend { get { throw null; } }\n+    }\n+    public delegate void UploadProgressChangedEventHandler(object sender, System.Net.UploadProgressChangedEventArgs e);\n+    public class UploadStringCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs\n+    {\n+        internal UploadStringCompletedEventArgs(string result, System.Exception exception, bool cancelled, object userToken) : base(exception, cancelled, userToken) { }\n+        public string Result { get { throw null; } }\n+    }\n+    public delegate void UploadStringCompletedEventHandler(object sender, System.Net.UploadStringCompletedEventArgs e);\n+    public class UploadValuesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs\n+    {\n+        internal UploadValuesCompletedEventArgs(byte[] result, System.Exception exception, bool cancelled, object userToken) : base(exception, cancelled, userToken) { }\n+        public byte[] Result { get { throw null; } }\n+    }\n+    public delegate void UploadValuesCompletedEventHandler(object sender, System.Net.UploadValuesCompletedEventArgs e);\n+    public class WebClient","path":"src/System.Net.Requests/ref/System.Net.Requests.cs","position":80,"original_position":80,"commit_id":"cefb9c156fee343952d0c7950504f7a02bf6cd4a","original_commit_id":"cefb9c156fee343952d0c7950504f7a02bf6cd4a","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"> it uses *WebRequest APIs but it should be using them only for implementation purposes with the current implementation\r\n\r\nIt's not just an implementation detail... there are exposed APIs that essentially require that WebRequest/WebResponse be used, e.g. https://github.com/dotnet/corefx/pull/11894/files#diff-ce48c170cda4f1a381cd880e4ca56562R173\r\n\r\nWe could split it into its own contract that sits on top of System.Net.Requests, I'm just not sure it buys much. @weshaggard, @terrajobst, opinions?  I don't feel strongly about it either way.","created_at":"2016-09-20T18:35:30Z","updated_at":"2016-09-20T18:35:30Z","html_url":"https://github.com/dotnet/corefx/pull/11894#discussion_r79681872","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/11894","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/79681872"},"html":{"href":"https://github.com/dotnet/corefx/pull/11894#discussion_r79681872"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/11894"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/11894","id":85915683,"html_url":"https://github.com/dotnet/corefx/pull/11894","diff_url":"https://github.com/dotnet/corefx/pull/11894.diff","patch_url":"https://github.com/dotnet/corefx/pull/11894.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/11894","number":11894,"state":"open","locked":false,"title":"Add WebClient to System.Net.Requests","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"This PR ports System.Net.WebClient to corefx.  The code is mostly taken from desktop and then cleaned up a bit stylistically.  The only major code rewrite was removing hundreds of lines of complicated APM callback-based code and replacing it with a few core async methods.  There's still plenty of more cleanup that can be done, but functionally this is sufficient.\r\n\r\nI also wrote a bunch of tests for it (~85% coverage), and added a few members to {Http}WebRequest in support of the WebClient implementation.  I did not expose those {Http}WebRequest members in the contract, though; that will be done when dedicated time is put into finishing off the WebRequest surface area.\r\n\r\nNote that a suggestion had been made to rewrite WebClient directly on top of HttpClient.  I declined to do so for several reasons, including because as-is it'll work with the other *WebRequest/Response objects as they're added to the implementation, and including because WebClient exposes several members that assume a WebRequest/Response-based implementation (e.g. GetWebRequest).  I've put WebClient into System.Net.Requests as it does tie in closely with these requests, analagous to TcpClient with Sockets.\r\n\r\nFixes https://github.com/dotnet/corefx/issues/11794\r\ncc: @davidsh, @cipop, @ericeil, @karelz ","created_at":"2016-09-20T06:03:55Z","updated_at":"2016-09-20T18:35:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a977f7856de814eac90f88b63f6fe4eb3bb572ac","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/11894/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/11894/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/11894/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/cefb9c156fee343952d0c7950504f7a02bf6cd4a","head":{"label":"stephentoub:add_webclient","ref":"add_webclient","sha":"cefb9c156fee343952d0c7950504f7a02bf6cd4a","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"repo":{"id":26551529,"name":"corefx","full_name":"stephentoub/corefx","owner":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephentoub/corefx","description":"This repository contains the foundational libraries that make up the .NET Core development stack.","fork":true,"url":"https://api.github.com/repos/stephentoub/corefx","forks_url":"https://api.github.com/repos/stephentoub/corefx/forks","keys_url":"https://api.github.com/repos/stephentoub/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephentoub/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephentoub/corefx/teams","hooks_url":"https://api.github.com/repos/stephentoub/corefx/hooks","issue_events_url":"https://api.github.com/repos/stephentoub/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/stephentoub/corefx/events","assignees_url":"https://api.github.com/repos/stephentoub/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/stephentoub/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/stephentoub/corefx/tags","blobs_url":"https://api.github.com/repos/stephentoub/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephentoub/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephentoub/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephentoub/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephentoub/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/stephentoub/corefx/languages","stargazers_url":"https://api.github.com/repos/stephentoub/corefx/stargazers","contributors_url":"https://api.github.com/repos/stephentoub/corefx/contributors","subscribers_url":"https://api.github.com/repos/stephentoub/corefx/subscribers","subscription_url":"https://api.github.com/repos/stephentoub/corefx/subscription","commits_url":"https://api.github.com/repos/stephentoub/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephentoub/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephentoub/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephentoub/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephentoub/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/stephentoub/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephentoub/corefx/merges","archive_url":"https://api.github.com/repos/stephentoub/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephentoub/corefx/downloads","issues_url":"https://api.github.com/repos/stephentoub/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/stephentoub/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/stephentoub/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/stephentoub/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephentoub/corefx/labels{/name}","releases_url":"https://api.github.com/repos/stephentoub/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/stephentoub/corefx/deployments","created_at":"2014-11-12T19:06:24Z","updated_at":"2016-08-17T18:03:41Z","pushed_at":"2016-09-20T18:11:39Z","git_url":"git://github.com/stephentoub/corefx.git","ssh_url":"git@github.com:stephentoub/corefx.git","clone_url":"https://github.com/stephentoub/corefx.git","svn_url":"https://github.com/stephentoub/corefx","homepage":"","size":97732,"stargazers_count":2,"watchers_count":2,"language":"C#","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":2,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"884a1b9e634c35790e72650639ecfd1e5219897c","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2016-09-20T17:57:56Z","pushed_at":"2016-09-20T18:31:04Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://docs.microsoft.com/dotnet/","size":142185,"stargazers_count":10536,"watchers_count":10536,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2618,"mirror_url":null,"open_issues_count":1524,"forks":2618,"open_issues":1524,"watchers":10536,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/11894"},"html":{"href":"https://github.com/dotnet/corefx/pull/11894"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/11894"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/11894/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/11894/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/11894/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/cefb9c156fee343952d0c7950504f7a02bf6cd4a"}}}}
{"actor":{"display_login":"stephentoub"}}