Reputation: 8589
Trying to convert a code base for Swift 3.0 Currently using
return (Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: nil).0, uploadData)
Where:
let mutableURLRequest = NSMutableURLRequest(url: URL(string: urlString)!)
Have the error "ParameterEncoding has no member URL"
. Also tried
return (Alamofire.ParameterEncoding.encode(mutableURLRequest).0, uploadData) and the doesn't work. Any ideas how to fix this? Any pointers would be really appreciated! Thanks!
Upvotes: 1
Views: 513
Reputation: 412
Alamofire has a struct URLEncoding, which confirms to the ParameterEncoding protocol.
var urlRequest:URLRequest? = nil
do {
try urlRequest = Alamofire.URLEncoding().encode(mutableURLRequest, with: parameters)
} catch {
}
return urlRequest!
Upvotes: 3