Brief backstory, our previous developer used ASIHTTPRequest to make POST requests and retrieve data from our webservice. For reasons unknown this portion of our app stopped
Use AFHTTPClient -postPath:parameters:success:failure:
, passing your parameters (nested dictionaries/arrays are fine). If you're expecting a plist back, be sure to have the client register AFPropertyListRequestOperation
.
In any case, setValue:forHTTPHeaderField:
is not what you want here. HTTP headers are for specifying information about the request itself; data is part of the request body. AFHTTPClient
automatically converts parameters into either a query string for GET
requests or an HTTP body for POST
, et al.