views:

532

answers:

1

Hi, I need to remove some of the headers, e.g. Accept, Accept-Language, etc. in a http request being sent from iPhone to server. NSMutableUrlRequest and CFHTTPMessageRef don't have a way to over-ride what is being sent in the header. It seems like there is no easy way to approach that. Any suggestions? Any help would be greatly appreciated. Thanks.

+1  A: 

Have you tried using -setAllHTTPHeaderFields? The docs say it replaces all current fields (rather than appending).

Ben Gottlieb
Aren't the Accept headers written in on top of anything you specify in setAll...
Roger Nolan
From my testing, any headers passed in to setAllHTTPHeaderFields will replace, not be appended to, existing headers.
Ben Gottlieb