问题
I've tried to request the desktop version of a webpage in this way but it doesn't work and I can't find anything on the web to help me
let url = NSURL(string: "*****")
let request = NSMutableURLRequest(URL: url!)
let newUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.6 Safari/537.11"
request.setValue(newUserAgent, forHTTPHeaderField: "User_Agent")
webView.loadRequest(request)
Could you please help me?
来源:https://stackoverflow.com/questions/34816464/how-to-request-the-desktop-version-of-a-webpage-in-swift-2