-1

I'm posting a json to server, but I'm getting response from server like this- "message": "invalid parameters: Access is denied"

i sending request like this-

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);
    }];

but i got response from server :

{
    "message": "invalid parameters: Access is denied",
    "data": null,
    "result": "false"
},

please give a good solution to fix this issue, thanks

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
karthick
  • 39
  • 6
  • we know nothing about the service you try to connect to. so how should we able to tell you the right parameters? But at least a key `"json"` seems to be suspect to me. – vikingosegundo Jan 15 '14 at 04:59
  • First check API document and see what needs to be send for key json. Please refer to API Document. – Zeeshan Jan 15 '14 at 06:21

1 Answers1

0
[httpClient postPath:@"hello" parameters:[NSDictionary dictionaryWithObjectsAndKeys:@"data1", @"data1_key", @"data2", @"data2_key2", nil]
codercat
  • 22,873
  • 9
  • 61
  • 85