Re: Open safari and send post variables
Re: Open safari and send post variables
- Subject: Re: Open safari and send post variables
- From: Conor Dearden <email@hidden>
- Date: Fri, 09 Jun 2006 13:44:08 +0200
As you stated NSURLConnection is what you want; you just have to look at the
documentation a bit longer:
file:///Developer/ADC Reference Library/documentation/Cocoa/Reference/Fo
undation/Classes/NSURLRequest_Class/Reference/Reference.html
The post part would be this:
//Create a request
NSMutableURLRequest* postURLRequest = [NSMutableURLRequest requestWithURL:
[NSURL URLWithString:@"http://www.apple.com/search"]];
//Make it a post
[postURLRequest setHTTPMethod:@"POST"];
//Set the body for the post
[postURLRequest setHTTPBody:[@"search=SomethingHere"
dataUsingEncoding:NSISOLatin1StringEncoding]];
//Start the connection with the post
theConnection=[[NSURLConnection alloc] initWithRequest:postURLRequest
delegate:self];
You will have to read up on NSURLConnection on how to implement the delegate
methods for reading the data.
Conor
www.bruji.com
_______________________________________________
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