I'm trying to do a JSON POST request (to create a new user) from my iOS app to a cloud back-end REST API using AFNetworking. In my view controller, I'm doing,
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSString *URLString = API_BASE_URL;
NSDictionary *parameters = @{@"userName": self.userNameTextField.text,
@"password": self.passwordTextField.text};
manager.requestSerializer = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil];
I've reviewed the docs, this SO post, and this R.Wenderlich tutorial, but my Frankenstein-ing skills are running out.
The compiler complains about
Incompatible pointer types assigning to 'AFHTTPRequestSerializer<AFURLRequestSerialization> *' from 'NSMutableURLRequest *'
Has anyone got a pointer to a working example of this or guidance on what might be wrong with my code.
Specifically, how do I initiate the action with a callback?