POST请求application-x-www-form-urlencoded with AFNetworking2.0失败错误响应代码= -1011

时间:2015-07-15 08:32:40

标签: ios objective-c http-post afnetworking-2

我正在尝试使用内容类型发出POST请求:'application / x-www-form-urlencoded'使用AFNetworking的[POST:parameters:success:failure]方法。

post-request在POSTMAN上完美运作。

由于我发送x-www-form-urlencoded数据,我使用AFHTTPRequestSerializer作为AFHTTPRequestOperationManager的requestSerializer(responseSerializer是AFJSONResponseSerializer)。

我将我的POST请求主体的参数作为NSDictionary传递给'parameters'参数。

不幸的是我收到以下错误:

failure: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: not found (404)" UserInfo=0x1700f2d00 {com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x174231ae0> { URL: https://xx.x.x.xxx/oauth/token } { status code: 404, headers {
Allow = POST;
"Cache-Control" = private;
Connection = close;
"Content-Type" = "application/json";
Date = "Wed, 15 Jul 2015 08:11:01 GMT";
Server = Apache;
"Strict-Transport-Security" = "max-age=15768000";
"Transfer-Encoding" = Identity;} }, NSErrorFailingURLKey=https://10.9.3.202/oauth/token, com.alamofire.serialization.response.error.data=<7b22636f 6465223a 3430342c 226d6573 73616765 223a224e 6f742046 6f756e64 227d>, NSLocalizedDescription=Request failed: not found (404)}

请帮忙! 感谢

0 个答案:

没有答案