AFNetworking Post Request returns bad request

问题内容:

I am trying to just login with in my app and put the wrong email and password foe handling the error bit when I clicked on Login button I get the folowing error:

Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo={NSLocalizedDescription=Request failed: bad request (400), NSErrorFailingURLKey=http://55.8.9/token, com.alamofire.serialization.response.error.data=<7b226572 726f7222 3a22696e 76616c69 645f6772 616e7422 2c226572 726f725f 64657363 72697074 696f6e22 3a225468 65207573 6572206e 616d6520 6f722070 61737377 6f726420 69732069 6e636f72 72656374 2e227d>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x6040006219a0> { URL: http://55.8.9/token } { Status Code: 400, Headers {
"Access-Control-Allow-Origin" =     (
    "*"
);
"Cache-Control" =     (
    "no-cache"
);
"Content-Length" =     (
    87
);
"Content-Type" =     (
    "application/json;charset=UTF-8"
);
Date =     (
    "Fri, 08 Dec 2017 13:10:56 GMT"
);
Expires =     (
    "-1"
);
Pragma =     (
    "no-cache"
);
Server =     (
    "Microsoft-IIS/10.0"
);
"X-Powered-By" =     (
    "ASP.NET"
);
} }}

问题评论:

1  
Your question is not clear, please edit your question to include a real question.
1  
<7b226572 726f7222 3a22696e 76616c69 645f6772 616e7422 2c226572 726f725f 64657363 72697074 696f6e22 3a225468 65207573 6572206e 616d6520 6f722070 61737377 6f726420 69732069 6e636f72 72656374 2e227d> means {"error":"invalid_grant","error_description":"The user name or password is incorrect."}. You want to show that: “The user name or password is incorrect”? What do you want to do exactly?

原文地址:

https://stackoverflow.com/questions/47715291/afnetworking-post-request-returns-bad-request

添加评论

友情链接:蝴蝶教程