Re: POST request on iPhone
Re: POST request on iPhone
- Subject: Re: POST request on iPhone
- From: Alastair Houghton <email@hidden>
- Date: Tue, 1 Jun 2010 12:52:03 +0100
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 (email@hidden)
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:
This email sent to email@hidden