I need to get the value of Error-Message in the failure block of my request.
Here's the error:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo=0x165151b0 {NSErrorFailingURLKey=http://203.125.112.203:8090/megumi01/api/zipData?lastSynced=1441161682, com.alamofire.serialization.response.error.response= { URL: http://203.125.112.203:8090/megumi01/api/zipData?lastSynced=1441161682 } { status code: 400, headers { "Access-Control-Allow-Headers" = "x-requested-with, Authorization, Content-Type, Accept"; "Access-Control-Allow-Methods" = "POST, GET, OPTIONS, DELETE, PUT"; "Access-Control-Allow-Origin" = "*"; "Access-Control-Max-Age" = 3600; "Cache-Control" = "no-cache, no-store, max-age=0, must-revalidate"; Connection = close; "Content-Type" = "application/json;charset=UTF-8"; Date = "Wed, 02 Sep 2015 10:38:57 GMT"; "Error-Code" = 0808; "Error-Message" = "No updates available"; Expires = 0; Pragma = "no-cache"; Server = "Apache-Coyote/1.1"; "Transfer-Encoding" = Identity; "X-Application-Context" = "application:9090"; "X-Content-Type-Options" = nosniff; "X-Frame-Options" = DENY; "X-XSS-Protection" = "1; mode=block"; } }, NSLocalizedDescription=Request failed: bad request (400)}
I have tried putting "error" into NSData so I could convert it to NSDictionary but it becomes nil.
May I know how could I get the value of the custom header "Error-Message"?
TYIA!