Re: Making POST (and PUT) requests
To: Erik Selberg <firstname.lastname@example.org>
Subject: Re: Making POST (and PUT) requests
From: Henrik Frystyk Nielsen <email@example.com>
Date: Tue, 23 Jan 1996 18:36:50 -0500
From firstname.lastname@example.org Tue Jan 23 18: 37:49 1996
Reply-To: Henrik Frystyk Nielsen <email@example.com>
X-Mailer: exmh version 1.6.2 7/18/95
Erik Selberg writes:
> Didn't need to hack the library... here are some code snippets. I use
> a class "URLClass" which has a bunch of spiffy methods, like
> isPostURL() etc. Looks like the java class, acually. Anyway, here's
> basically how I do a GET/POST.
> DANGER DANGER DANGER DANGER!
> I encountered two bugs in the library (4.0) which cause this code NOT
> to work. The first is in streampipe(), which causes the output stream
> of anything but a GET request to be HTBlackHole (i.e. /dev/null!)
This is correct and it has been fixed in the latest version 4.0C
> second being in HTMIME_put_block which causes anything using the
> content_length field (like POST requests) to stop reading after
> you've _read_ content_length bytes (the content_length is used for
> telling the server how many bytes you're writing). I'm assuming Henrik
> will have patches for these in a day or so.
This is a problem as long as you use the same anchor for both data objects. By
using two anchors - one that represents the form data which you keep in memory
and one which represents what you get back from the remote server then this is
not a problem. This is how it works while using PUT or POST from a local file,
for example and this is how I imagined it to work on memory buffers as well.
Henrik Frystyk Nielsen, <firstname.lastname@example.org>
World-Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA