开发者

Changing User Agent

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 .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜