我正在向服务器发布一个json,但我收到服务器的响应,如下所示 - “message”:“无效参数:访问被拒绝”
我发送这样的请求 -
AFHTTPClient * httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSDictionary *parameters = [NSDictionary dictionaryWithObject:json forKey:@"json"];
[httpClient postPath:@"/xxx/yyyy/zzzz" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"success parsing %@",responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"failure parsing %@",error);
}];
但是我得到了服务器的响应:
{
"message": "invalid parameters: Access is denied",
"data": null,
"result": "false"
},
请提供一个很好的解决方案来解决这个问题,谢谢
答案 0 :(得分:0)
[httpClient postPath:@"hello" parameters:[NSDictionary dictionaryWithObjectsAndKeys:@"data1", @"data1_key", @"data2", @"data2_key2", nil]