如何使用Alamofire传递queryStrings和JSON Body

时间:2016-12-29 09:14:33

标签: ios swift alamofire

 return try Alamofire.URLEncoding.queryString.encode(urlRequest, with: parameters)

我应该如何传递JSON主体作为参数。

1 个答案:

答案 0 :(得分:0)

Alamofire.request(URL,                               方法:.post,                               参数:参数,                               encoding:JSONEncoding.default,                               标题:[:])

            .responseJSON { response in

// ...继续 //参数必须有效[String:AnyObject]