Re: POST through sockets

cwilson@spry.com
Tue, 31 Jan 1995 18:24:35 +0100


Dave Banthorpe EOS <daveb@eos4.eos.co.uk> writes:
>Can anybody help me with this problem:
>...
>Open a socket to the HTTP server (where the CGI is held).
>Open the text file for reading and send the following down the socket:
>
>POST /cgi-bin/testprogram
>Content-type: text/plain
>Content-length: 256
>(file gets put here)
>...
>Got any ideas?

It could be that you are not sending the HTTP/1.0 request line properly. Try
appending " HTTP/1.0" to the first line (and also make sure you're sending CRLF
pairs to terminate lines) like so:

POST /cgi-bin/testprogram HTTP/1.0
Content-type: text/plain
Content-length: 256
(file gets put here)

I think the server is probably not realizing you're doing HTTP/1.0, and assumes
you're trying a 0.9 request since it is malformed. If you plan on getting any
data back, you might also want to send some Accept: lines.

-Chris Wilson

:::::::::::::::::::::<<< NETWORKING THE DESKTOP >>>::::::::::::::::::::
Chris Wilson Spry, Inc.
WWW Technology Lead 316 Occidental Avenue S. 2nd Floor
Email: cwilson@spry.com Seattle, WA 98104
Phone: (206) 447-0300 FAX: (206) 447-9008
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::