• 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: Jerry Krinock <email@hidden>
  • Date: Sun, 13 Jul 2008 18:41:58 -0700


On 2008 Jul, 11, at 16:52, Jens Alfke wrote:

I assume the HTML will contain a dynamically generated <form> that points to the right URL and has the right input fields already filled out?

Yes.

This issue of "sending a POST to the browser" has come up before, in the context of emails containing forms. Mail.app has never handled such forms, for exactly these reasons; but this little HTML idea might be a decent solution.

And to my surprise, it pretty much just worked...

<html>
    <head>

<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css" charset="utf-8">

        <title>
            Sheep Systems
        </title>

<style TYPE="text/css">
<!--
.SheepN { font-family: "Arial", "Osaka", "Verdana", "Helvetica"; font-size:12.0px; }
-->
</style>


        <SCRIPT LANGUAGE="JavaScript">
            <!-- Begin
                function goGet() {
                    document.form1.submit() ;
                    return true ;
                }
            //  End -->
        </script>

    </head>

<body onload="goGet()">
<table border=0 cellpadding=20>
<tr>
<td align="center">
<SPAN CLASS=SheepN>Will contact sheepsystems.com ...</SPAN>
</td>
</tr>
<tr>
<td align="center">
<form name="form1" id="form1" method="post" action="http://sheepsystems.com/cgi-test/sales/Offeror.pl";>


<input type="hidden" name="SOME_NAME" value="SOME_VALUE">
<input type="hidden" name="ANOTHER_NAME" value="ANOTHER_VALUE">
<input type="hidden" name="ETCETERA_NAME" value="ETCETERA_VALUE">
<SPAN CLASS=SheepN>Javascript disabled? </ SPAN><input type="submit" onclick="goGet();return false;" value="Click Here">
</form>
</td>
</tr>
</table>
</body>
</html>


except that if you need the name/value pairs be sometimes missing, you need to generate the whole <input> tags in your code.

Test in various browsers, and in each one, open Preferences and test with Javascript Enabled and also with Javascript Disabled.
_______________________________________________
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>)
 >Re: POST NSURLRequest, send Response to Web Browser (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: What causes a kCFStreamEventEndEncountered
  • Next by Date: protocol plumbing
  • Previous by thread: Re: POST NSURLRequest, send Response to Web Browser
  • Next by thread: Using pcap or tcpdump kills the wireless network
  • Index(es):
    • Date
    • Thread