I'm trying to add a value to the header for a URL request.
Something like this works just fine:
[urlRequest addValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
But this doesn't even show up in the header:
NSString *authString = [[NSString alloc] initWithString:
[defaults objectForKey:@"auth"]];
[urlRequest addValue:authString forHTTPHeaderField:@"iphoneID"];
I'm completely stumped. The auth string is around 90 characters long. Is this a problem?
Edit: Here's the code I'm trying:
NSString *authString = [[NSString alloc] initWithString:[defaults objectForKey:@"auth"]];
[urlRequest addValue:authString forHTTPHeaderField:@"iphoneid"];
[urlRequest addValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
I can see the Accept-Encoding header being sent through Wireshark, but iphoneid is nowhere to be found. It's just a string, 80-90 characters long.
Another Update: So it seems that the problem isn't the field "iphoneid" but rather the authString I'm trying to pass into it. Other strings that I just create with the @"something" work fine, but the auth string that I pull from NSUserDefaults doesn't appear.
Suggestions on how to debug this?