W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2002

Can anyone produce an HTPostAnchorToChunk that works?

From: Carl Daniel <cpdaniel@pacbell.net>
Date: Fri, 09 Aug 2002 09:58:40 -0700
To: www-lib@w3.org
Message-id: <014601c23fc6$02ddf3d0$0200a8c0@carl2000>

libwww is very frustrating!  Has a mind of it's own, I swear...

I need to post data (NOT form data, just raw data) and get the response in an HTChunk.

Unfortunately, HTPostAnchor inevitably writes the response to a file, while HTPostFormDataToChunk requires that the POST
data be form data.  So far, my attempts to merge the two, and the suggestions of several others have resulted in
absolutely no change in behavior whatsoever.

In particular, this doesn't work;

HTChunk * HTPostAnchorToChunk(HTParentAnchor *  source, HTAnchor*
        destination, HTRequest* request)
{
  if (source && destination && request)
 {
   HTChunk * chunk = NULL;
   HTStream * target = HTStreamToChunk(request, &chunk, -1);
   HTRequest_setOutputStream(request, target);
   if (HTPostAnchor(source, destination, request))
    return chunk;
   else
  {
    HTChunk_delete(chunk);
    return NULL;
   }
  }
  return NULL;
}

.. although it sure seems like it ought to.

What's the secret?

-cd
Received on Friday, 9 August 2002 12:58:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:42 GMT