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: Tue, 13 Nov 2001 12:12:13 -0600
Message-ID: <07E98776DFF1BE448D9C9BA60A79ADA49F9696@amwntx1.ugsolutions.com>
To: "'Bang, Steinar'" <Steinar.bang@tandbergtv.com>
Cc: www-lib@w3.org
To using the ExtensionMethod, I still need to hack the HTMethod enum. There
is no such method like HTRequest_setMethod(char* methodName). If we can set
the method as a string, this extension method can be really easily to use.
So you think there is no apparent side effect?

Thank you,

-----Original Message-----
From: Bang, Steinar [mailto:Steinar.bang@tandbergtv.com]
Sent: Monday, November 12, 2001 11:17 PM
To: 'Wang, Xinju'
Cc: www-lib@w3.org
Subject: Re: get body of a response

Wang, Xinju [mailto:Xinju.Wang@ugs.com] wrote:

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

This sounds like pretty much the same experiences I
had, with the same fixes.

> 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 don't think he did, but I don't know for sure.

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

This sounds like a very good idea.  Hacking enums in
header files to get in new methods for webdav, didn't
feel like a very scalable approach...:-)

Have you run into any problems where the library
internally treat methods as bitmasks (also in my
archived discussions with Josh Watts)?

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

Hm... HTMethod is an enum, no...?

What will you put in the method argument?  An integer 
value not in the enum?  A new value in the enum, saying 
that this is an extension value?

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

It's possible that stuff in libwww treat method values
as bitmasks, but I don't know this for sure.  That could
be a complication.  And it also limits the possible
number of simultanous methods, at least if you're
sticking inside a 32 bit limit.

This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to
TANDBERG Television. If received in error please notify the sender and
destroy the original message and attachments.
Received on Tuesday, 13 November 2001 13:14:00 UTC

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