我坚持这个错误我该怎么办? Transport security has blocked a cleartext HTTP但这不起作用我能做什么 让Url = NSURL(字符串:“http://mydomain.com.mx/ObtenerMapa.php”)
let rqst = NSMutableURLRequest(URL: Url!)
rqst.HTTPMethod = "POST"
//rqst.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
let tarea = NSURLSession.sharedSession().dataTaskWithRequest(rqst)
{
(data,response,error )in
if error != nil
{
return
}
//var err: NSError?
do {
let json = try NSJSONSerialization.JSONObjectWithData(data!, options: .MutableContainers) as? NSDictionary
//let responseString = NSString (data: data, encoding: NSUTF8StringEncoding)
if let parseJson = json {
let mensaje = "Mensaje"
let error = "Error"
print(parseJson)
//let mensaje = (parseJson["mensaje"] as? String)!
//let error = (parseJson["status"] as? String)!
completion(message: mensaje, error: error)
}else{
completion(message: "Servicio no disponible", error: "Error")
}
} catch {
completion(message: "Servicio no disponible", error: "Error")
}
}
tarea.resume()