主要出現如下錯誤:
請求失敗-Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" 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, 07 Nov 2015 01:07:18 GMT";
Expires = "Thu, 01 Jan 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 (400), com.alamofire.serialization.response.error.data=<7b226572 726f7222 3a22696e 76616c69 645f6772 616e7422 2c226572 726f725f 636f6465 223a3231 3332352c 22726571 75657374 223a222f 6f617574 68322f61 63636573 735f746f 6b656e22 2c226572 726f725f 75726922 3a222f6f 61757468 322f6163 63657373 5f746f6b 656e222c 22657272 6f725f64 65736372 69707469 6f6e223a 22696e76 616c6964 20617574 686f7269 7a617469 6f6e2063 6f64653a 36356464 33643966 63626462 65616664 66343963 32336438 36663832 36313931 2666726f 6d3d3834 34622676 69743d66 7073227d>}
解決辦法:
Check for errors in the URL. The most common reason for a 400 Bad Request error is because the URL was typed wrong or the link that was clicked on points to a URL with a specific kind of mistake in it, like a syntax problem.
檢查URL里面的錯誤。400錯誤請求錯誤最常見的原因是由於URL輸入錯誤或點擊的鏈接指向一個URL和一種特定的錯誤,比如語法問題。
Important: This is most likely the problem if you get a 400 Bad Request error. Specficially, check for extra, typically non-allowed, characters in the URL like a percentage character. While there are perfectly valid uses for something like a % character, you won't often find one in a standard URL.
重點:這是最可能出現的問題如果你得到一個400錯誤請求錯誤。尤其,檢查在URL中一些典型的字符,比如%字符。像%字符在一些地方能夠被有效使用,你不會在標准URL中就發現一個。
