I need to call some methods from a soapy web service in my quick application, so I think I should use a special parameter encoding, but when I create a closure for this encoding, it seems to never be called. Am I doing something wrong?
Here is my code:
let custom: (URLRequestConvertible, [String: AnyObject]?) -> (NSURLRequest, NSError?) = {
(URLRequest, parameters) in
let mutableURLRequest = URLRequest.URLRequest.mutableCopy() as NSMutableURLRequest
mutableURLRequest.setValue("text/xml; charset=utf-8", forHTTPHeaderField: "Content-Type")
mutableURLRequest.HTTPBody = body
return (mutableURLRequest, nil)
}
Alamofire.request(.POST, WebServiceURLString, parameters: nil, encoding: .Custom(custom)).responseString { (request, response, data, error) -> Void in
println(data)
}
source
share