gowalla/AFNetworking — Issue #104: AFHttpClient: POST and multiple AFHTTPClientParameterEncodings
Author: IngmarStein
Created: 2011-11-09 14:31:12+00:00
State: open

Using AFHttpClient's postPath:parameters:success:failure: method, it's currently not possible to pass both query parameters as well as other parameters (i.e. a JSON- or plist-encoded body or form parameters). A possible solution would be to pass the URL including the query parameters instead of a path relative to the base URL.

Also, I guess that there are use-cases where you want to pass only query parameters to a POST request. This could be done by adding AFQueryParameterEncoding to the AFHTTPClientParameterEncoding enum and adding the following case

case AFQueryParameterEncoding:
url = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:[path rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", AFQueryStringFromParameters(parameters)]];
[request setURL:url];
break;

to requestWithMethod:path:parameters