I was calling a Rest API locally from terminal. This was like below:
http -v -f --timeout=60 GET 'http://localhost:firstname.lastname@example.org&password=mypassword'
GET /email@example.com&password=mypassword HTTP/1.1
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=utf-8
HTTP/1.1 400 Bad Request
Date: Mon, 28 Mar 2016 16:59:08 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sun, 27- Mar-2016 16:59:13 GMT
"debugMessage": "Submitted credentials for token [org.apache.shiro.authc.UsernamePasswordToken - firstname.lastname@example.org, rememberMe=true] did not match the expected credentials.Submitted credentials for token [org.apache.shiro.authc.UsernamePasswordToken - email@example.com, rememberMe=true] did not match the expected credentials.: The subject was expected to be true, but was false",
Alamofire.request(method, urlString, parameters: parameters, encoding: .URL, headers: cookieHeader)
let jsonData = alamofireResponse.result.value
For me removing the
validate() allowed me to see the reason the request was failing. For some reason when
validate fails, the data of the response is not parsed.