ios - The same URL, why urlsession gets wrong, but using NSURLConnection always succeeds -


    let url = url(string: "https://soufunapp.3g.fang.com/http/sf2014.jsp?messagename=usercount&wirelesscode=dd146fd49861797918ada44b7e201180")      let task = urlsession.shared.datatask(with: urlrequest(url: url!)) { (data, response, error) in         print("always fail")         if error != nil {             print(error!)         }     }     task.resume()      nsurlconnection.sendasynchronousrequest(urlrequest(url: url!), queue: operationqueue.main) { (response, data, error) in         print("always succeed")     } 

error domain=nsurlerrordomain code=-1001 "the request timed out." userinfo={nsunderlyingerror=0x60000005ccb0 {error domain=kcferrordomaincfnetwork code=-1001 "(null)" userinfo={_kcfstreamerrorcodekey=-2102, _kcfstreamerrordomainkey=4}}, nserrorfailingurlstringkey=https://soufunapp.3g.fang.com/http/sf2014.jsp?messagename=usercount&wirelesscode=dd146fd49861797918ada44b7e201180, nserrorfailingurlkey=https://soufunapp.3g.fang.com/http/sf2014.jsp?messagename=usercount&wirelesscode=dd146fd49861797918ada44b7e201180, _kcfstreamerrordomainkey=4, _kcfstreamerrorcodekey=-2102, nslocalizeddescription=the request timed out.}

similarly, use of safari can not open url, chrome can data


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -