User _ agent: Foobar/1.0 r n < br > User-Agent: Mozilla/5.0(iPhone; U; CPU)
IPhone OS 3 _ 1 _ 2,如 Mac OS X; en-us) AppleWebKit/528.18(KHTML,如
壁虎) Mobile/7D11r n
上面的内容出现在解剖的 HTTP 数据包中,基本上证实了 Sfjava 从该论坛引用的内容。值得注意的是,“ User-Agent”变成了“ User _ agent”
+ (void)initialize
{
// Set user agent (the only problem is that we can’t modify the User-Agent later in the program)
// iOS 5.1
NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:@”Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3”, @”UserAgent”, nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];
}