我需要使用 Alamofire 发送补丁请求,我的问题是我需要在此请求中同时使用 URLEncoding 和 JSONEncoding。
let url = URL(string: "https://kinto.dev.mozaws.net/v1/buckets/\(self.bucketName!)/collections/\(self.collectionName!)/records")!
parameters?["data"] = kintoDictionary
Alamofire.request(url, method: .patch, parameters: self.parameters, encoding: JSONEncoding.default, headers: self.headers).responseJSON { (response) in
...
}
如何在此请求中添加带有参数的 URLEncoding ?我应该使用 NSURLRequest 而不是 URL 吗?