- From: Ailleen Lien <alien@clientsoft.com>
- Date: Mon, 23 Apr 2001 11:35:21 -0400
- To: "'Roland Bickel'" <r.bickel@cmg.nl>
- Cc: "'www-lib@w3.org'" <www-lib@w3.org>
Do you have HTRequest_setOutputFormat() after HTRequest_new()? If you do
not have, You still get Null String back from HTPostAnchorToChunk().
/* Create a request */
request = HTRequest_new();
HTRequest_setOutputFormat(request, HTAtom_for("text/xml")
Good Luck
Aileen
-----Original Message-----
From: Roland Bickel [mailto:r.bickel@cmg.nl]
Sent: Monday, April 23, 2001 10:28 AM
To: 'www-lib@w3.org'
Subject: POST - how to retrieve the response ?? HELP !!
Hello everybody !!
I hope some of you guys can help me with this.. i'm right now able to POST a
message to a HTTP server (responses to my last question still heavily
appreciated !!) , and i'm also a receiving a response. Mostly, i'm using the
HTPostAnchor function to do this.
My question is : How can I retrieve the answer from the POST request,
without reading it from file ?? I scanned through the w3c libwww archive,
and tried the HTPostAnchorToChunk function of Aileen, but to no avail :-(.
My terminate handler always says that the chunk is null.. I'm using
asynchronous sockets, btw..
structure of the prog is like
terminatehandler(....)
{
printf("test %s\n", HTChunk_toCString((HTChunk *)param);
/* more irrelevant stuff */
}
HTPostAnchorToChunk(...)
{
HTChunk * chunk = NULL;
HTStream *target = HTStreamToChunk(request, &chunk, 0);
if (chunk)
{
HTNetaddAfter(terminate_handler, NULL, chunk, HT_ALL,
HT_FILTER_LAST);
/* rest as in Aileen's example */
}
}
main()
{
HTProfile_newHTMLnoCachecClient(....);
/* set up some events and callbacks to do other stuff */
/* Create anchors and so on.. */
HTPostAnchorToChunk(..);
HTEventloop_newlist();
}
am i forgetting something ??
help appreciated !!
with kind regards,
Roland Bickel
Received on Monday, 23 April 2001 11:35:25 UTC