I need to send patch request using Alamofire, my problem is I need to use both URLEncoding and JSONEncoding in this request.
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
...
}
how to add URLEncoding with parameters in this request ?? Should I use NSURLRequest instead of URL ?
Swift 3.0
your url need to remove space, so encode your url using below.
you can try this