I am trying to change my user agent like this
[req setValue:userAgent forHTTPHeaderField:@"User-Agent"];
Where userAgent is an NSString and it seems to work in the app because when I NSLog it it shows up as what I changed it to
NSLog(@"user agent = %@", [req valueForHTTPHeaderField: @"User-Agent"]);
But when I go to this site http://whatsmyuseragent.com/ the user agent is unchang开发者_StackOverflow中文版ed. Does anyone know why this could be.
Thanks Clinton
If you go to the site with Browser like Safari , the user agent is unchanged . You set the value is just for your Request one time , not for the browser or all the request .
精彩评论