Alamofire 使用 post 上传 json 给 服务器
2018-07-03 本文已影响0人
文瑶906
Alamofire 使用的是 4.7.2
Swift 4
Alamofire.request(strUrl, method: httpMethod, parameters: parameters, encoding: JSONEncoding.default , headers: nil)
.validate().responseJSON { response in
print("response===",response)
}
如果要是 出现 "Extra argument 'method' in call"
有可能是 encoding 的错误或者是 strURL 的错误。反正不一定是 method 参数的错误