I am attempting to send some parameters to an API using AFNetworking. I have reduced my application code to:
NSDictionary *params = @{@"team":@"WashingtonNationals"};
[_client postPath:@"updateTeamAlert"
parameters:params
success:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSString *responseStr = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
NSLog(@"Request Successful, response '%@'", responseStr);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
NSLog(@"[HTTPClient Error]: %@", error.localizedDescription);
}];
On the server I am using the following PHP to debug:
if (isset($_POST["team"])) {
echo "team set ok";
}
else {
echo "team not set";
}
I am consistently receiving the 'team not set' response.
When I vardump the POST I am returned:
'array(0) {
}
(an empty array I assume)?
What am I missing?