I am involved in using AFNetworking .
I know that I can use AFHTTPClient to create a POST request using json.
My question is: is there a way to make a standard POST request (i.e. with the content type application/x-www-form-urlencoded )? My server server does not accept json, because the client must use the same login form through the web interface.
In the 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!
source share