Re: POST syntax for form-filling

From: Juan Carlos Castro y Castro <[email protected]>
Date: Fri, 16 Jul 1999 15:33:30 -0300

Henrik Nordstrom wrote:

> Juan Carlos Castro y Castro wrote:
> >
> > I'm writing an itsy-bytsy teeny weeny HTTP client which (with help of a
> > nearby Squid proxy) is able to fetch any URL without even having to use
> > a resolver (it's for a small device). The only thing missing is how I
> > build the POST request to simulate form-filling (GET is trivial). The
> > HTTP 1.0 RFC wouldn't help. Where's the authoritative info?
>
> POST content for form submission is defined in the forms section of
> RFC1866 (HTML 2.0) and any later HTML RFCs. HTTP only specifies the
> message format, not the format of payload data (and POST may be used for
> other actions than HTML form submission)
>
> Anyway, the format is very simple. It is a normal HTTP message with a
> Content-Length and request body (much like a reply from a HTTP server).
> Content-Type should be set to "application/x-www-form-urlencoded" and
> the payload data is a URL encoded representation of the FORM contents
> identical to how the query string is contstructed in a GET request.

Well, I'm almost there. I telnet to www.pcshop.com.br port 80 and dropped
this:

------------------------------------------------------------
POST /cgi-bin/accounting/postopraw.cgi HTTP/1.0
Content-type: application/x-www-form-urlencoded
Content-length: 64

OPCODE=DIALINLOG&username=jcastro&password=wrong&mes=07&ano=1999
------------------------------------------------------------

64 is the length of the encoded querystring, without linefeed. As I expected,
the server responded without the need for a final <Enter>. But the response
was not the same I get when I type values through the form which is at:

 http://www.pcshop.com.br/extrato.htm

It seems the query string is not arriving at the program like it should. What
am I doing wrong?

Thanks all,

Received on Fri Jul 16 1999 - 12:15:54 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:47:26 MST