W3C home > Mailing lists > Public > www-lib@w3.org > October to December 2001

RE: get body of a response

From: Wang, Xinju <Xinju.Wang@ugs.com>
Date: Mon, 12 Nov 2001 16:11:02 -0600
Message-ID: <07E98776DFF1BE448D9C9BA60A79ADA49F9694@amwntx1.ugsolutions.com>
To: "'Steinar Bang'" <sb@dod.no>
Cc: www-lib@w3.org
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!

-----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
> 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

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