I need to set the HTTP header for a request. In the documentation for the NSURLRequest class I didn't find anything regarding the HTTP header. How can I set the HTTP header to contain custom data?
You need to use a NSMutableURLRequest
NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] initWithURL:url]
autorelease];
[request setValue:VALUE forHTTPHeaderField:@"Field You Want To Set"];
or to add a header:
[request addValue:VALUE forHTTPHeaderField:@"Field You Want To Set"];