I am having issues with adding a header to NSMutableURlRequest, the problem is that when I add the header below "Authorization" it does not show up. However if I replace my instance variable "auth" below with a static string exp (@"asdadsadsadga") it the "Authorization" header will show up. I am pretty lost at this point.
NSURL *url = [NSURL URLWithString:@"https://www.google.com/analytics/feeds/accounts/default"];
NSMutableURLRequest *profileRequest = [NSMutableURLRequest requestWithURL:url];
NSLog(auth); //prints correctly
NSString *authString = [NSString stringWithFormat:@"GoogleLogin Auth=%@", auth];
[profileRequest addValue:authString forHTTPHeaderField:@"Authorization"];
NSDictionary *allheaders = [profileRequest allHTTPHeaderFields];
for (id key in allheaders)
{
//Nothing prints
NSLog(@"key: %@, value: %@", key, [allheaders objectForKey:key]);
}
NSLog(auth); //Prints correctly