IOS request appears "request Failed:bad request (400)"

Source: Internet
Author: User
Tags response code

The following errors occur mainly:

request failed -error domain=com.alamofire.error.serialization.response code=-1011 "request Failed:bad Request" userinfo={com.alamofire.serialization.response.error.response=<nshttpurlresponse:0x7cec30d0> {url:https:/ /api.weibo.com/oauth2/access_token} {Status code:400, headers {

"Cache-control" = "No-cache";

Date = "Sat, 01:07:18 GMT";

Expires = "Thu, 1970 00:00:00 GMT";

Pragma = "No-cache";

Server = "nginx/1.6.1";

"Api-server-ip" = "10.75.25.115";

}}, Nserrorfailingurlkey=https://api.weibo.com/oauth2/access_token, Nslocalizeddescription=request Failed:bad Request (com.alamofire.serialization.response.error.data=<7b226572), 726f7222 3a22696e 76616c69 645f6772 616e7422 2c226572 726f725f 636f6465 223a3231 3332352c 22726571 75657374 223a222f 6f617574 68322f61 63636573 735f746f 6b656 E22 2c226572 726f725f 75726922 3a222f6f 61757468 322f6163 63657373 5f746f6b 656e222c 22657272 6f725f64 65736372 69707469 6 f6e223a 22696e76 616c6964 20617574 686f7269 7a617469 6f6e2063 6f64653a 36356464 33643966 63626462 65616664 66343963 323364 36663832 36313931 2666726f 6d3d3834 34622676 69743d66 7073227d>}

Workaround:

Check for errors in the URL. The most common reason for a all-in-a-bad Request error is because the URL was typed wrong or the link this was clicked on Poin TS to a URLs with a specific kind of mistake in it, like a syntax problem.

Check for errors inside the URL. 400 the most common cause of error request errors is due to a URL input error or a clicked link pointing to a URL and a specific error, such as a syntax issue.

Important:this is most likely the problem if you get a "a" error Request. specficially, check for extra, typically non-allowed, characters in the URL like a percentage character. While there is perfectly valid uses for something as a% character, you won ' t often the find one in a standard URL.

Focus: This is the most likely problem if you get a 400 error request error. In particular, check some typical characters in the URL, such as the% character. Like the% character can be used effectively in some places, you will not find one in the standard URL.

IOS request appears "request Failed:bad request (400)"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.