请解释如何传递json数据 将“结果”改为新视图,例如文本域?
以下是相关的代码:
// make http POST request
let uploadTask = session.uploadTask(with: request as URLRequest, from: body?.data(using: String.Encoding.utf8)!){
(data, response, error) in
(response as? HTTPURLResponse)?.statusCode
// URL Object to String
let result = String(data: data!, encoding: String.Encoding.utf8)
}
uploadTask.resume()