• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Open safari and send post variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Open safari and send post variables
      • From: Yorh <email@hidden>
  • Prev by Date: Re: Open safari and send post variables
  • Next by Date: Re: FrontRow remote control events
  • Previous by thread: Re: Open safari and send post variables
  • Next by thread: Re: Open safari and send post variables
  • Index(es):
    • Date
    • Thread