Re: POST request on iPhone
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=coriolis-systems.com; h= subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=aug07; bh=pC+EoG6sdoQd380Ec12QbCmVTCs=; b=K1qWXydbhk+RWQInEmjMuJcTl5ZQ nN7Bi+h1v8lKAZH6pzi/bi8yllpvajqdt2w9bW4Asqgwe/asdj3fWvayzGU56KvX J8R3LyfgC9E8zFy8zkA49ubNjrxAGyUWzGmy5Pkuz9notwTrLMsDAC5GatmYCvgI aH05vYT34LZ5mBI= On 1 Jun 2010, at 11:03, Joshua Tucker wrote:
has anyone got any sample code for a POST request for interfacing with an API such as the DirectAdmin API?
Ideally, something that works like this in Obj-C (example is in PHP) would be great: http://www.directadmin.com/sample_api.txt. The API documentation is at http://www.directadmin.com/api.html but I haven't been able to make any sense of it.
You should be able to use NSURLRequest for this. Looks from the API as if you stick the command name in the URL, and pass the other arguments as form parameters in the usual way; see <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4> for information about form encoding. Kind regards, Alastair. -- http://alastairs-place.net _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... This email sent to site_archiver@lists.apple.com
participants (1)
-
Alastair Houghton