AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFHTTPRequestSerializer serializer]; //not working with or without this.
NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:@"id", @"id", @"pwd", @"pwd", @"func", @"func", nil];
[manager POST:@"http://someurl.com/abc/func.php" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"Success: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
为什么我要
错误域= AFNetworkingErrorDomain代码= -1016“请求失败: 不可接受的内容类型:text / html“UserInfo = 0x1f89e740 {NSErrorFailingURLKey = http://someurl.com/abc/func.php, AFNetworkingOperationFailingURLResponseErrorKey =,NSLocalizedDescription =请求失败:不可接受 content-type:text / html}