2016-01-27 59 views

回答

0

使用NSMutableURLRequest設置要

let session = NSURLSession() 

guard let url = NSURL(string: "http://www.google.com") else { 
    fatalError("Error creating NSURL for http://www.google.com") 
} 

let request = NSMutableURLRequest(URL: url) 
request.HTTPMethod = "CONNECT" 

let task = session.dataTaskWithRequest(request) 

task.resume() 
+0

謝謝你的答案任何HTTP方法! – Rao