On Feb 18, 2016, at 11:32 AM, Jens Alfke <j...@mooseyard.com> wrote:
> I discovered yesterday that the networking layer of our library, which talks 
> to a REST API, is sending every request twice when the server uses HTTP Basic 
> auth. This obviously reduces performance, especially over high-latency 
> cellular networks. It’s especially bad when we send a POST or PUT request 
> with a large body (like a media attachment), because the body will get sent 
> at full speed until the server responds, and then it gets sent again.

The other thing that a well-written client can do in that case is make use of 
the "Expect: continue" header to allow the server to accept or reject the 
request (or request authorization) before the large POST/PUT body is sent. I 
don't know offhand if there's a way to get CFNetwork to do that.

    http://tools.ietf.org/html/rfc7231#section-5.1.1 
<http://tools.ietf.org/html/rfc7231#section-5.1.1>


(If do you gain any insight into how to hint NSURLSession to do particular 
things with credentials, please share! This has been a pain point for us as 
well.)



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to