W3C home > Mailing lists > Public > www-jigsaw@w3.org > November to December 2000

Client-Side Posts [Was: Posting a Form using Jigsaw]

From: John Philip Anderson <jpanderson_215@hotmail.com>
Date: Sat, 16 Dec 2000 19:31:23 -0000
To: aspertedison@yahoo.com
Cc: www-jigsaw@w3.org
Message-ID: <F89SJIEoPXCFbN4TZya000005ad@hotmail.com>
Dear Mr. Edison Aspert,

  Here is code to help you do Client-Side Posts with jigsaw:

        request = manager.createRequest();
	request.setMethod("POST");
	host = "http://foo.bar.etc";
	request.setURL(new URL(host.concat("/fcgi-bin/flogn")));
	String postdata = "userid=foo&password=bar";
	MimeType mt = new MimeType("application/" + "x-www-form-urlencoded");
	request.setContentType(mt);
	request.setOutputStream(new StringBufferInputStream(postdata));
	request.setContentLength(postdata.length());
	reply = manager.runRequest(request);

Please note, that the format of String postdata will vary, depending on the 
field "name[s]" of the CGI that your posting to.  Furthermore, I have 
manually URL encoded the information in the String postdata.  I believe that 
you code alternatively use Base64Encoder.processString() to do this 
automatically.  Finally, you may have to switch the MimeType.

If you have not read the HTTP/1.1 Specification, a.k.a. RFC 2616, 
(http://www.w3.org/Protocols/), I strongly recommend that you do so.  I 
believe that RFC 2616 is very usefully as Jigsaw documentation.

        Truly yours,
        John Philip Anderson.



>From: Edison Aspert <aspertedison@yahoo.com>
>To: www-jigsaw@w3.org
>Subject: Posting a Form using Jigsaw
>Date: Thu, 14 Dec 2000 17:41:01 -0800 (PST)
>
>HI,
>
>I tried posting(POST) a form from a Java Application.
>But some reason which I am not aware I am not able to
>do it.
>
>Is it possible to do it using the Jigsaw API? If yes
>can you help me with the code. It should be a
>Application.
>
>Thanks
>
>Aspert Edison
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Shopping - Thousands of Stores. Millions of Products.
>http://shopping.yahoo.com/
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
Received on Saturday, 16 December 2000 14:31:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT