I have a general question. Using the NSMutableURLRequest object in the iPhone SDK, can I set the HTTPMethod to POST when retrieving data from a server?
+1
A:
Normally you should either POST some data or GET some data, though issuing a POST and then fetching some data in a single request is perfectly valid.
Just to be clear, it is in fact quite common for a POST to return some data representing some sort of result message in response to the POST. Other uses (like piggy-backing an unrelated GET onto the POST) would be frowned upon.
Marcelo Cantos
2010-08-10 22:32:12
A:
If you're willing to use third party libraries I can highly recommend ASIHTTPRequest:
http://allseeing-i.com/ASIHTTPRequest/
I've used this in library for http posts in a number of iPhone applications and been very happy with it.
Just to clarify: I'm not associated with these guys in any way, just like the library!
mad-dog-software
2010-08-11 04:40:35