我正在使用 Alamofire 向服务器发出发布请求。发布请求工作正常。
问题:发出发布请求时,它会返回一些我需要的数据。我如何存储/检索该数据
POST 请求:
Alamofire.request(.POST, postURL, parameters: params)
最佳答案
获取响应闭包添加
.response { 请求、响应、数据、错误 }
到代码的末尾
即
Alamofire.request(.POST, "http://httpbin.org/get", parameters: ["foo": "bar"])
.response { request, response, data, error in
print(request)
print(response)
print(data)
print(error)
}
关于swift - Alamofire POST 返回数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32977204/