Loading ...
Sorry, an error occurred while loading the content.

RE: [rest-discuss] Doing an HTTP PUT from HTML?

Expand Messages
  • Ramin Firoozye
    Hi Roger, How about this? The HTTPURLConnection java class can submit a PUT request method. If you compile it into an applet, then you can invoke the applet in
    Message 1 of 13 , Aug 5, 2002
    • 0 Attachment
      Hi Roger,
       
      How about this?
       
      The HTTPURLConnection java class can submit a PUT request method. If you compile it into an applet, then you can invoke the applet in the browser and pass the form data down to it. The applet doesn't need any visual representation. It can sit behind the scenes ready for invocation via Javascript. The only thing is that the URL you are PUTting to should be on the same machine the Applet is coming from (for applet sercurity reasons). If you need the Java code for the PUT class, holler and I'll be happy to post it.
       
      The other way is to use a server 'redirector' that does it for you. That might be more flexible.
       
      Cheers,
      Ramin
       
       -----Original Message-----
      From: Roger L. Costello [mailto:costello@...]
      Sent: Monday, August 05, 2002 5:42 AM
      To: rest-discuss@yahoogroups.com
      Cc: Costello,Roger L.
      Subject: [rest-discuss] Doing an HTTP PUT from HTML?

      Hi Folks,

      The following question actually has a lot to do with REST, although it
      may not seem so.  Once I get my tutorial completed I will show how it
      all fits in with REST.  But for now, here's the question:

      I would like to create a REST resource which serves up XML and receives
      XML.  For those clients at a browser the XML will be styled into HTML
      via an XSLT stylesheet.  Suppose that this styling results in an HTML
      form that the user fills in to create a Purchase Order.  After the user
      fills in the form he presses "Submit".  I would like for the Submit
      action to result in kicking off some script which harvests the data in
      the HTML form, create an XML string from the form data, and then HTTP
      PUTs the XML string back to the resource.  That's where I am stuck.  I
      know how to write some Javascript to harvest the form data and create an
      XML string, but I don't know how to then HTTP PUT the XML string to the
      resource (i.e., server).  Any ideas?  /Roger



      To unsubscribe from this group, send an email to:
      rest-discuss-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    • Ramin Firoozye
      Wow! That s the silliest thing I ve ever heard a browser do. How did you test that? ... From: Seairth Jacobs [mailto:seairth@seairth.com] Sent: Monday, August
      Message 2 of 13 , Aug 5, 2002
      • 0 Attachment
        Wow! That's the silliest thing I've ever heard a browser do.
        How did you test that?
        -----Original Message-----
        From: Seairth Jacobs [mailto:seairth@...]
        Sent: Monday, August 05, 2002 8:24 AM
        To: rest-discuss
        Subject: Re: [rest-discuss] Doing an HTTP PUT from HTML?

        rom: "Uther, James" <james.uther@...>
        >
        >   People are free to correct me here (it's been a while), but: no browsers
        > support HTTP PUT.

        I don't know about the other ones, but I know that in IE6, PUT is internally
        substituted with GET instead.  How do you like them apples!  Frankly, I
        would have preferred it giving me an error than changing the meaning of my
        request...

        ---
        Seairth Jacobs
        seairth@...



        To unsubscribe from this group, send an email to:
        rest-discuss-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      • Seairth Jacobs
        Simple HTML Form, where METHOD= PUT . :) Okay, it may not be a really good/reliable test, but I was surprised at the outcome. If anything, I would have
        Message 3 of 13 , Aug 5, 2002
        • 0 Attachment
          Simple HTML Form, where METHOD="PUT".  :)  Okay, it may not be a really good/reliable test, but I was surprised at the outcome.  If anything, I would have expected it to treat the PUT as a POST (which still would have been wrong, IMHO).  I think the reason that GET is used is because it's the "default" value of the METHOD attribute [1].  I guess they figure that if an invalid value is given, then use the default value instead.
           
          And as for how I knew it was converted to a GET, I have a server-side ISAPI extension that dumps the entire request to a file for debugging purposes.
           
           
          ---
          Seairth Jacobs
          seairth@...
           
          ----- Original Message -----
          Sent: Monday, August 05, 2002 1:08 PM
          Subject: RE: [rest-discuss] Doing an HTTP PUT from HTML?

          Wow! That's the silliest thing I've ever heard a browser do.
          How did you test that?
          -----Original Message-----
          From: Seairth Jacobs [mailto:seairth@...]
          Sent: Monday, August 05, 2002 8:24 AM
          To: rest-discuss
          Subject: Re: [rest-discuss] Doing an HTTP PUT from HTML?

          rom: "Uther, James" <james.uther@...>
          >
          >   People are free to correct me here (it's been a while), but: no browsers
          > support HTTP PUT.

          I don't know about the other ones, but I know that in IE6, PUT is internally
          substituted with GET instead.  How do you like them apples!  Frankly, I
          would have preferred it giving me an error than changing the meaning of my
          request...

          ---
          Seairth Jacobs
          seairth@...



          To unsubscribe from this group, send an email to:
          rest-discuss-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          To unsubscribe from this group, send an email to:
          rest-discuss-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        • Mark Nottingham
          Hi Dan, I raised [1] an issue [2] about this a while back. Were you looking at the latest editors drafts? Cheers, 1.
          Message 4 of 13 , Aug 5, 2002
          • 0 Attachment
            Hi Dan,

            I raised [1] an issue [2] about this a while back. Were you looking at the
            latest editors' drafts?

            Cheers,

            1. http://lists.w3.org/Archives/Public/www-forms-editor/2002Jan/0007.html
            2.
            http://www.w3.org/MarkUp/Forms/Group/2002/f2f-Cannes/minutes.html#resoluti
            on7 [member-only]



            ----- Original Message -----
            From: "Dan Brickley" <danbri@...>
            To: "Roger L. Costello" <costello@...>
            Cc: <rest-discuss@yahoogroups.com>
            Sent: Monday, August 05, 2002 6:37 AM
            Subject: Re: [rest-discuss] Doing an HTTP PUT from HTML?


            > -----BEGIN PGP SIGNED MESSAGE-----
            > Hash: SHA1
            >
            >
            >
            > Roger L. Costello wrote:
            > > Hi Folks,
            > >
            > > The following question actually has a lot to do with REST, although it
            > > may not seem so. Once I get my tutorial completed I will show how it
            > > all fits in with REST. But for now, here's the question:
            > >
            > > I would like to create a REST resource which serves up XML and
            receives
            > > XML. For those clients at a browser the XML will be styled into HTML
            > > via an XSLT stylesheet. Suppose that this styling results in an HTML
            > > form that the user fills in to create a Purchase Order. After the
            user
            > > fills in the form he presses "Submit". I would like for the Submit
            > > action to result in kicking off some script which harvests the data in
            > > the HTML form, create an XML string from the form data, and then HTTP
            > > PUTs the XML string back to the resource. That's where I am stuck. I
            > > know how to write some Javascript to harvest the form data and create
            an
            > > XML string, but I don't know how to then HTTP PUT the XML string to
            the
            > > resource (i.e., server). Any ideas? /Roger
            >
            > I thought XForms might have something to say on this -- but after a
            > rather quick look at the spec I can't see anything.
            >
            > http://www.w3.org/TR/xforms/
            >
            > [[
            > XForms is an XML application that represents the next generation
            > of Forms for the Web. By splitting traditional XHTML forms into
            > three parts - data model, instance data, and user interface -
            > it separates presentation from content, allows reuse, gives
            > strong typing - reducing the number of round-trips to the
            > server, as well as offering device independence and
            > a reduced need for scripting.
            >
            > XForms is not a free-standing document type, but is intended to
            > be integrated into other markup languages, such as XHTML.
            > ]]
            >
            > Guess this doesn't answer your question Roger, but I'd be interested to
            > hear if anyone here has looked into using XForms, and how it fits with
            > the REST perspective.
            >
            > cheers,
            >
            > Dan
            >
            > -----BEGIN PGP SIGNATURE-----
            > Version: GnuPG v1.0.6 (GNU/Linux)
            > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
            >
            > iD8DBQE9Tn+uPhXvL3Mij+QRAs9wAJ0bY/0AaOER2bj+USwfDRnGWtrYrwCgqzi5
            > vEzGGuLWf+FltyIYwqPxh5k=
            > =y3d3
            > -----END PGP SIGNATURE-----
            >
            >
            > To unsubscribe from this group, send an email to:
            > rest-discuss-unsubscribe@yahoogroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to
            http://docs.yahoo.com/info/terms/
            >
            >
          • Jeffrey Winter
            ... Both IE and Mozilla convert anything that s not a POST into a GET. I had tested this against both IIS and Tomcat. And just to make sure it wasn t the
            Message 5 of 13 , Aug 5, 2002
            • 0 Attachment
              > Wow! That's the silliest thing I've ever heard a browser do.
              > How did you test that?

              Both IE and Mozilla convert anything that's not a POST into a GET.
              I had tested this against both IIS and Tomcat. And just to make sure
              it wasn't the server logic itself converting for your convenience,
              I checked it outbound from the client using the apache TcpTunnelGui
              utility and it's definitely the client doing the conversion.
            • Jeffrey Winter
              There should also be a delete . :_) - winter ... From: Mark Nottingham To: Roger L. Costello ; Dan Brickley
              Message 6 of 13 , Aug 5, 2002
              • 0 Attachment
                There should also be a "delete". :_)

                - winter

                ----- Original Message -----
                From: "Mark Nottingham" <mnot@...>
                To: "Roger L. Costello" <costello@...>; "Dan Brickley" <danbri@...>
                Cc: <rest-discuss@yahoogroups.com>
                Sent: Monday, August 05, 2002 1:34 PM
                Subject: Re: [rest-discuss] Doing an HTTP PUT from HTML?


                Hi Dan,

                I raised [1] an issue [2] about this a while back. Were you looking at the
                latest editors' drafts?

                Cheers,

                1. http://lists.w3.org/Archives/Public/www-forms-editor/2002Jan/0007.html
                2.
                http://www.w3.org/MarkUp/Forms/Group/2002/f2f-Cannes/minutes.html#resoluti
                on7 [member-only]



                ----- Original Message -----
                From: "Dan Brickley" <danbri@...>
                To: "Roger L. Costello" <costello@...>
                Cc: <rest-discuss@yahoogroups.com>
                Sent: Monday, August 05, 2002 6:37 AM
                Subject: Re: [rest-discuss] Doing an HTTP PUT from HTML?


                > -----BEGIN PGP SIGNED MESSAGE-----
                > Hash: SHA1
                >
                >
                >
                > Roger L. Costello wrote:
                > > Hi Folks,
                > >
                > > The following question actually has a lot to do with REST, although it
                > > may not seem so. Once I get my tutorial completed I will show how it
                > > all fits in with REST. But for now, here's the question:
                > >
                > > I would like to create a REST resource which serves up XML and
                receives
                > > XML. For those clients at a browser the XML will be styled into HTML
                > > via an XSLT stylesheet. Suppose that this styling results in an HTML
                > > form that the user fills in to create a Purchase Order. After the
                user
                > > fills in the form he presses "Submit". I would like for the Submit
                > > action to result in kicking off some script which harvests the data in
                > > the HTML form, create an XML string from the form data, and then HTTP
                > > PUTs the XML string back to the resource. That's where I am stuck. I
                > > know how to write some Javascript to harvest the form data and create
                an
                > > XML string, but I don't know how to then HTTP PUT the XML string to
                the
                > > resource (i.e., server). Any ideas? /Roger
                >
                > I thought XForms might have something to say on this -- but after a
                > rather quick look at the spec I can't see anything.
                >
                > http://www.w3.org/TR/xforms/
                >
                > [[
                > XForms is an XML application that represents the next generation
                > of Forms for the Web. By splitting traditional XHTML forms into
                > three parts - data model, instance data, and user interface -
                > it separates presentation from content, allows reuse, gives
                > strong typing - reducing the number of round-trips to the
                > server, as well as offering device independence and
                > a reduced need for scripting.
                >
                > XForms is not a free-standing document type, but is intended to
                > be integrated into other markup languages, such as XHTML.
                > ]]
                >
                > Guess this doesn't answer your question Roger, but I'd be interested to
                > hear if anyone here has looked into using XForms, and how it fits with
                > the REST perspective.
                >
                > cheers,
                >
                > Dan
                >
                > -----BEGIN PGP SIGNATURE-----
                > Version: GnuPG v1.0.6 (GNU/Linux)
                > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
                >
                > iD8DBQE9Tn+uPhXvL3Mij+QRAs9wAJ0bY/0AaOER2bj+USwfDRnGWtrYrwCgqzi5
                > vEzGGuLWf+FltyIYwqPxh5k=
                > =y3d3
                > -----END PGP SIGNATURE-----
                >
                >
                > To unsubscribe from this group, send an email to:
                > rest-discuss-unsubscribe@yahoogroups.com
                >
                >
                >
                > Your use of Yahoo! Groups is subject to
                http://docs.yahoo.com/info/terms/
                >
                >


                To unsubscribe from this group, send an email to:
                rest-discuss-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
              • Ramin Firoozye
                ... Hmm. I m guessing one started it and the other decided to be compatible (even if it made no sense). Someone ought to go over and fix up Mozilla (and add
                Message 7 of 13 , Aug 5, 2002
                • 0 Attachment
                  > Both IE and Mozilla convert anything that's not a POST into a GET.
                  > I had tested this against both IIS and Tomcat. And just to make sure
                  > it wasn't the server logic itself converting for your convenience,
                  > I checked it outbound from the client using the apache TcpTunnelGui
                  > utility and it's definitely the client doing the conversion.
                  >

                  Hmm. I'm guessing one started it and the other decided to be
                  'compatible' (even if it made no sense).

                  Someone ought to go over and fix up Mozilla (and add a 'delete'
                  too, while they're at it...)
                Your message has been successfully submitted and would be delivered to recipients shortly.