Re: How to do an HTTP POST in Cocoa
Re: How to do an HTTP POST in Cocoa
- Subject: Re: How to do an HTTP POST in Cocoa
- From: "Nick Kreeger" <email@hidden>
- Date: Sat, 10 Jun 2006 12:54:17 -0500
Here is how to POST using Cocoa API's:
NSString* content = [@"item=" stringByAppendingString:@"Something to
Post"];
NSURL* url = [NSURL URLWithString:@"http://www.url.com/pagetopost"];
NSMutableURLRequest* urlRequest = [[NSMutableURLRequest alloc]
initWithURL:url];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setHTTPBody:[content dataUsingEncoding:
NSASCIIStringEncoding]];
After this point you can do several things, such as perform the post in a
WebKit window, or read this for managing the response:
http://www.awprofessional.com/articles/article.asp?p=468381&seqNum=2&rl=1
- Kreeger
On 6/10/06, Graham <email@hidden> wrote:
Hi,
I need to perform an HTTP POST to a url in my Cocoa app.
What is the basic recipe for this in Cocoa as I can only find
documentation on non-Cocoa classes for this?
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden