background preloader

POST & GET

Facebook Twitter

HTTP get method in Xcode. Sending HTTP GET and POST from Cocoa. Ever wanted to send a form to a webpage from within Cocoa.

Sending HTTP GET and POST from Cocoa

Here's how. GET forms are the easiest to do. You just tack on your variables to the end of the URL, like this: Then you could use your standard NSURLDownload to fetch the file.A POST form is pretty much the same thing, except you need to specify that you are sending a POST, and you need to stick your variables into the http body instead of tacking them onto the end of the URL. Here's how to setup the URL request for a POST:

Iphone - Simple http post example in xcode.