I am trying to use AFNetworking 2.0 on iOS7 to send a JSON-encoded array via POST to a web server.
_manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[NSURL URLWithString:baseURL]];
_manager.requestSerializer = [AFJSONRequestSerializer serializer];
[_manager POST:@"getlistings" parameters:@{@"listings":item_ids} success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"%@",responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"%@",error);
}];
item_ids is an array which is passed in, it's essentially @[1234,1235], just a few numbers. The web service which receives this request doesn't have anything set for $_POST, but the JSON I'm sending does show up in $HTTP_RAW_POST_DATA. Why is this? Am I doing something wrong with my request, or is it more likely that there is a problem on the server side?
Thanks in advance!