• 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: POST NSURLRequest, send Response to Web Browser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POST NSURLRequest, send Response to Web Browser


  • Subject: Re: POST NSURLRequest, send Response to Web Browser
  • From: Philip Aker <email@hidden>
  • Date: Fri, 11 Jul 2008 12:38:37 -0700

On 08-07-11, at 11:07, Jerry Krinock wrote:

At one point in my app, I send an NSURLRequest to a remote server using method POST, but I want the response to be rendered in the user's default web browser. So I write the response to a temporary file and then send message -[NSWorkspace openURL:::::]. Looks a little weird because the address bar in the web browser shows the temporary file:/// URL, but it works.


Can anyone think of any other way to do this? I know I could have WebKit and render it in a window in my app.


Maybe LSOpenCFURLRef().

Thanks, Philip. No, that doesn't do it.

Sorry, I failed to notice the POST (which now appears quite large…).


I think I've figured out the answer. Instead of sending the POST using NSURLConnection, I'm going to write a little temporary html file. This little html file will have an onLoad() javascript which immediately sends the POST, and a button for users that don't have javascript enabled. Now, tell NSWorkspace to open ^this^ temporary file. Now, Safari sends the POST, thus Safari gets back the response. Seems like it should work.


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >POST NSURLRequest, send Response to Web Browser (From: Jerry Krinock <email@hidden>)
 >Re: POST NSURLRequest, send Response to Web Browser (From: Philip Aker <email@hidden>)
 >Re: POST NSURLRequest, send Response to Web Browser (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Using pcap or tcpdump kills the wireless network
  • Next by Date: RE: PAC files and CFNetworkCopyProxiesForAutoConfigurationScript()
  • Previous by thread: Re: POST NSURLRequest, send Response to Web Browser
  • Next by thread: Re: POST NSURLRequest, send Response to Web Browser
  • Index(es):
    • Date
    • Thread