RE: get body of a response

In HTTP.c, I changed the code to treat 207 the same as 200 and I can get the
response body back! It turns out that before the change, the library thinks
207 as a failure and wipe out the output stream buffer.

For the request body, I tried the approach mentioned in your discussions
with Josh Watts: add a new data field char* body in _HTRequest, and in the
HTTPGen_new() in HTTPGen.c, send the body through when the body is not NULL.
And it worked.

Did Josh check in his change?

I also tried to add a extension method to libwww. The idea is this generic
function lets user specify the method, headers, url, and body of a request
and send the request over the network.  The user should know what he's doing
by using this function. It should look like:

void ExtensionMethod(HTMethod method, char* url, char* body, HTAssocList*
headers, HTResponse* response);

So the user doesn't have to write a new function whenever new methods been
added to extend HTTP. Will this have any side effects? 

Thank you!
Xinju

-----Original Message-----
From: Steinar Bang [mailto:sb@dod.no]
Sent: Monday, November 12, 2001 1:13 PM
To: Wang, Xinju
Cc: www-lib@w3.org
Subject: Re: get body of a response


>>>>> "Wang, Xinju" <Xinju.Wang@ugs.com>:

> Another question related to this multi status code. In HTTP.c, there is
the
> following code:

> case 207:	/* Partial Update OK */
> 	HTRequest_addError(me->request, ERR_INFO, NO, HTERR_PARTIAL_OK,
> 	me->reason, (int) strlen(me->reason), "HTTPNextState");
> 	http->next = HTTP_OK;
> 	http->result = HT_PARTIAL_CONTENT;
> 	break;

> Why the status code 207 is replaced by the HT_PARTIAL_CONTENT (206)?

My guess is that it is some old experimental code left in place.

> Is there some reason to convert the code?

To make it be handled in the same way as HT_PARTIAL_CONTENT, I guess.

However, that isn't the way 207 Multi Status of WebDAV is meant to be
handled.  I guess 200 OK comes closest, so that's what I used in the
diff I sent in my other message.

Received on Monday, 12 November 2001 17:13:01 UTC