ios - Handle non-JSON response from POST request with Alamofire -
i'm using alamofire 3 , end point i'm calling (i don't own server) accepts post request , returns html response.
i able html response when using curl in command line, alamofire doesn't return response body, header.
this code:
let headers = [ "referer": "someurl" ] alamofire.request(.post, url, headers: headers) .validate() .response { request, response, data, error in // response } response is:
optional(<nshttpurlresponse: 0x7f9ba3759760> { url: someurl } { status code: 200, headers { connection = "keep-alive"; "content-encoding" = gzip; "content-type" = "text/html"; date = "thu, 22 sep 2016 15:19:20 gmt"; server = nginx; "transfer-encoding" = identity; vary = "accept-encoding"; } }) and data is:
optional<nsdata> - : <> any thoughts?
Comments
Post a Comment