Swift 3>>如何将数据传递到从HTTP POST请求接收的下一个视图

时间:2017-01-31 12:43:27

标签: swift3 httprequest nsurlconnection nsurlsession

请解释如何传递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()

0 个答案:

没有答案