2

I have a couple of UITextFields in my view and a button. When the user fills them out and hits the button I would like to create a POST request and open the resulting page in Safari. I've gotten the request property built and ready to go using this example and others: How do I make HTTP post request for getting JSON object in response for iPhone application?

However I'm stuck on how to send the request object to safari, any help would be appreciated.

Community
  • 1
  • 1
Brett Wagner
  • 1,134
  • 2
  • 10
  • 18

3 Answers3

2

I've found this link that may help. The author of it just creates some temporary html file that opens up in safari and then safari sends the POST and gets response...

Ariel
  • 2,430
  • 1
  • 17
  • 20
1

As far as I am aware, you cannot actually send an NSURLRequest object to Safari. However, you can use UIWebView's - (void)loadRequest:(NSURLRequest *)request method to load the request in a UIWebView.

If you need the link to open in something resembling a full browser, you could try following iCode Blog's tutorial on creating a web browser.

Katfish
  • 698
  • 7
  • 13
0

Check out (BOOL)[UIApplication openURL:(NSURL *)url] - UIApplication

bshirley
  • 8,217
  • 1
  • 37
  • 43