I downloaded apple's demo for using HTTP POST and GET (Their sample app has a tabbar with different parts) and the code is so confusing!
Could anybody give me some sample code or a link to some tutorials about it? :)
Thanks!
I downloaded apple's demo for using HTTP POST and GET (Their sample app has a tabbar with different parts) and the code is so confusing!
Could anybody give me some sample code or a link to some tutorials about it? :)
Thanks!
There are many ways to implement HTTP Request in objective-c ,
CFNetwork
library is designed for this purpose but the easiest way to develop http request is to useNSURLConnection
.Here is a sample :
you will receive the response in
didreceiveResponse:
anddidreceiveData:
delegates.This walkthrough by Matt Long is particularly good: http://www.cimgf.com/2010/02/12/accessing-the-cloud-from-cocoa-touch/
hope this will help you, if you want to post a form:
this is a simple way to use GET:
you may also want to check this sample
You can find more details here: http://www.redcodelabs.com/2009/08/objective-c-http-post-get-data/