0

I am using HttpClient with CFNetworkHandler.

On iOS 9.0 I always get an empty response back:

var client = new HttpClient(new CFNetworkHandler());
var request = new HttpRequestMessage(HttpMethod.Post, uri);
var response = await client.SendAsync (request, token);
response.EnsureSuccessStatusCode ();
var content = await response.Content.ReadAsStringAsync ();

It works in older iOS versions.

If I create the HttpClient with the default c'tor new HttpClient() it works but then it doesn't use CFNetworkHandler.

Update I switched to using ModernHttpClient and it works on iOS 9.0. So I assume the problem is in CFNetworkHandler.

daramasala
  • 3,040
  • 2
  • 26
  • 33
  • I have the same problem too, if you investigate further `httpResponseMessage.Content` has a header with `Content-Length: 892` so obviously the data is there but ... something isn't working. – ta.speot.is Dec 21 '15 at 01:29
  • Agree, I experience exactly the same behavior - content length is correct but the content is empty. – daramasala Dec 21 '15 at 05:42

0 Answers0