Re: CFNetwork is not adding Authorization: headers proactively
Re: CFNetwork is not adding Authorization: headers proactively
- Subject: Re: CFNetwork is not adding Authorization: headers proactively
- From: Wim Lewis <email@hidden>
- Date: Mon, 22 Feb 2016 11:57:00 -0800
On Feb 18, 2016, at 11:32 AM, Jens Alfke <email@hidden> 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.
(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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden