Re: NSURLConnection inserting Accept-Language and Accept headers
Re: NSURLConnection inserting Accept-Language and Accept headers
- Subject: Re: NSURLConnection inserting Accept-Language and Accept headers
- From: Quinn <email@hidden>
- Date: Fri, 25 Sep 2009 11:04:27 +0100
At 11:49 -0700 21/9/09, Mark Pauley wrote:
Thanks for the report. You may be able to cut them out of the
request during the willSendRequest delegate message handler, which
is called just before we send any request.
This seems to work. Three things to consider:
o In your willSendRequest delegate method you can't just modify the
request because it's not mutable. Use -mutableCopy to make a mutable
copy of it.
o You can't remove a header by calling -setAllHTTPHeaderFields:
because that method merges the values from the dictionary you supply
into the request. Instead you have to call
-setValue:forHTTPHeaderField: with a nil value.
o I was testing on 10.6. YMMV on earlier systems because the URL
loading system has changed a lot in the last year or so.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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