I am very upset to figure out how to add a lowercase header field to NSMutableURLRequest.
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:MyURLString]];
[urlRequest setValue:@"aValue" forHTTPHeaderField:@"field"];
In the above example, the "field" switches to "Field" because the header field names are not case sensitive. I would think that this should not be, but it is. The API I'm working with is case sensitive, so my GET request is ignored. Is there a way to override the case switch?
source
share