HttpClient / CFNetworkHandler: SendAsync never returns if server returns http code 415

softlionsoftlion FRBeta ✭✭✭

I'm sending a POST request with a forms url encoded content using HttpClient.SendAsync(message, cancellationToken). The server returns 415 as .NET Core does not bind url encoded content when a FromBody attribute is present.

SendAsync should throw an exception, but it does not. It stays stuck in some kind of internal wait.

I switched to NSUrlSessionHandler and that fixed it.

Using the managed handler is not an option, as it bypasses the proxies defined in the device.

Sign In or Register to comment.