W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Re: Problems with POST

From: MOREAU Jean-Jacques <moreau@crf.canon.fr>
Date: Tue, 02 Mar 1999 16:49:28 +0100
Message-ID: <36DC0888.5622AB1B@crf.canon.fr>
To: Isabelle Delagarde <delagard@ssti.fr>
CC: www-lib@w3.org

Isabelle Delagarde wrote:

> I would like to POST data with format "a=b&c=d&..." followed by a MIME
> file : everything needs to be in the same request.

I've digged into the library's code, and haven't found how to do this
(elegantly) either -although I would think it is supported, as my reading of
the latest HTTP draft is that this is a perfectly legal operation...

Please find below a patch to apply to ComLine/src/HTLine.c, which is my
closest attempt at implementing this functionality in the w3c sample program
(which I believe did not implement the '-post -dest' option properly).

Of course, any further help on this topic will be appreciated!


PS. Sorry for not providing a patch file; I am compiling under Win98/Cygnus!

    case METHOD_POST:
 if (formdata) {
     HTParentAnchor * posted = NULL;
#if 1
     posted = HTPostFormAnchor(formfields, (HTAnchor *) cl->anchor,
     status = posted ? YES : NO;
     /* If we want output to a chunk instead */
     post_result = HTPostFormAnchorToChunk(formfields, (HTAnchor *)
     status = post_result ? YES : NO;
 } else {
#if 0
     if (SHOW_MSG) HTPrint("Nothing to post to this address\n");
     status = NO;
     FILE * stream;
     char postString[4096];

     char * postDataURL = HTAnchor_address((HTAnchor *) cl->anchor);
     char * tail = strrchr(postDataURL, '/') + 1;
     stream = fopen(tail, "r");
     fread(postString, sizeof(char), 4096, stream);

     HTAnchor_setDocument(cl->anchor, postString);
     HTAnchor_setLength(cl->anchor, strlen(postString));
     HTAnchor_setFormat(cl->anchor, WWW_RAW);

     HTLink_removeAll((HTAnchor *) cl->anchor);
     HTLink_add((HTAnchor *) cl->anchor, (HTAnchor *) cl->dest,
         NULL, METHOD_POST);

     status = HTPostAnchor(cl->anchor, (HTAnchor *) cl->dest,


Received on Tuesday, 2 March 1999 10:52:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:49 UTC