I'm learning to use AFNetworking
.
I know I can use AFHTTPClient
for making a POST request with json.
My question is: is there a way to make a standard POST request (that is, with a content type of application/x-www-form-urlencoded
)? My server backend doesn't accept json, because the client should use the same form for login via web.
In past I used ASIHTTPRequest
and I used this code:
url = [NSURL URLWithString:@"www.example.org/login/"];
request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:self.username forKey:@"username"];
[request setPostValue:self.password forKey:@"password"];
[request startAsynchronous];
Thanks!