这里我得到了一个奇怪的问题,比如我能够向模拟器发出请求但是在真实设备中出现了“无法读取数据”这样的错误还附加了屏幕截图
我的代码:
let urlPath: String = url_to_request
let url:NSURL = NSURL(string: urlPath)!
let session = URLSession.shared
let request = NSMutableURLRequest(url: url as URL)
request.httpMethod = "POST"
request.cachePolicy = NSURLRequest.CachePolicy.reloadIgnoringCacheData