{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/15191","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/15191/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/15191/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/15191/events","html_url":"https://github.com/dotnet/corefx/issues/15191","id":200815539,"number":15191,"title":"Allow null HttpResponseMessage in HttpClient.SendAsync?","user":{"login":"tmenier","id":1350414,"avatar_url":"https://avatars.githubusercontent.com/u/1350414?v=3","gravatar_id":"","url":"https://api.github.com/users/tmenier","html_url":"https://github.com/tmenier","followers_url":"https://api.github.com/users/tmenier/followers","following_url":"https://api.github.com/users/tmenier/following{/other_user}","gists_url":"https://api.github.com/users/tmenier/gists{/gist_id}","starred_url":"https://api.github.com/users/tmenier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmenier/subscriptions","organizations_url":"https://api.github.com/users/tmenier/orgs","repos_url":"https://api.github.com/users/tmenier/repos","events_url":"https://api.github.com/users/tmenier/events{/privacy}","received_events_url":"https://api.github.com/users/tmenier/received_events","type":"User","site_admin":false},"labels":[{"id":497898703,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Net.Http","name":"area-System.Net.Http","color":"d4c5f9","default":false},{"id":206504884,"url":"https://api.github.com/repos/dotnet/corefx/labels/Design%20Discussion","name":"Design Discussion","color":"5319e7","default":false},{"id":145399957,"url":"https://api.github.com/repos/dotnet/corefx/labels/enhancement","name":"enhancement","color":"207de5","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-14T16:57:14Z","updated_at":"2017-01-15T00:39:21Z","closed_at":null,"body":"I understand that making this change could quite possibly have far-reaching implications, so I guess at the very least I'd like to start a discussion and understand why it is the way it is.\r\n\r\nCurrently [`HttpClient.SendAsync`](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpClient.cs#L392) checks that the returned `HttpResponseMessage` is not null and throws an `InvalidOperationException` if it is. (Specifically [here](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpClient.cs#L444-L447) and [here](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpClient.cs#L476-L479).) I question why that check is necessary. It seems valid to want to implement a custom `HttpMessageHandler` that returns a null response in specific scenarios and not consider it an error condition. But with this behavior in `HttpClient`, you're basically forced to implement that flow through exception handling upstream.\r\n\r\nI'm curious to get the team's thoughts on this. Thanks!"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/272664671","html_url":"https://github.com/dotnet/corefx/issues/15191#issuecomment-272664671","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/15191","id":272664671,"user":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"created_at":"2017-01-15T00:39:21Z","updated_at":"2017-01-15T00:39:21Z","body":"It is a fundamental design principle that the handler's SendAsync() method for HttpClient always return a non-null HttpResponseMessage.  That design is part of the original design for HttpClient when we built the API for .NET 4.5.  It would be a breaking change to alter that principle."}}
{"actor":{"display_login":"davidsh"}}