Gunnar Henne | 9 Jan 15:53 2007
Picon

Example for fetching Headers and Content


Hello,

I need to fetch binary and html files from a webserver. I have studied 
the examples and found some für fetching the body and others for 
fetching the whole answer from the webserver, including un-interpreted 
headers.

 From the documentation I know that there is a MIME Parser in libwww 
which is able to strip of the headers (but keep them in separate memory 
for later) and do some content-decoding (i.e. decode Base64 Content). 
But I didn't get it to work.
Generally I want to do this:

1) Set up a request url
2) Set up additional request headers
3) Send the request, get the response, meanwhile letting libwww handle 
all the protocol specific stuff like multipart etc.
4) Ask the response for the complete list of key-value headers send by 
the server
5) Ask the response for a value of a given single key
6) If the url is a html page -> get the Text (in the body) as Chunk -> 
Transform to c-string
    If the url is a file -> get the file (in the body) as Chunk -> 
Transform to void* and length

Can you give me some information, how I can achive this? My biggest 
question is, how I have to connect the request with the MIME Parser and 
get the Results of the MIME parsing (headers an content separated and 
decoded).
(Continue reading)

Frode | 17 Jan 10:29 2007
Picon

Header documentation script


Hi!

I have a question about the appealing documentation reference in  
libwww. Is it the header comments that generates the HTML  
documentation? And is there any script that can redo this available?

I'm asking because I thought about using the library's nice and  
gentle comment style in other projects, instead of the doxygen style.  
I've tried to look for it in the CVS repository but can't find any  
obviously evidence of any such script. I have the feeling that for  
some years ago I read about this somewhere and somehow, but can't  
find it now.

Thanks for any hints,
Frode

Vic Bancroft | 18 Jan 06:17 2007
Picon
Picon

Re: Header documentation script


Frode wrote:

> Hi!

Aloha!

> I have a question about the appealing documentation reference in  
> libwww. Is it the header comments that generates the HTML  
> documentation? And is there any script that can redo this available?

Actually the header files are generated from the HTML documentation, as 
described in the step,

  http://www.w3.org/Library/cvs.html#Easy

This a full filled example of what has been called 'literate 
programming'   . . .

    "The main idea is to treat a program as a piece of literature,
    addressed to human beings rather than to a computer. The program is
    also viewed as a hypertext document, rather like the World Wide Web." 
    -- Knuth [1]

> I'm asking because I thought about using the library's nice and  
> gentle comment style in other projects, instead of the doxygen style.  

It is interesting the effect of text which is conciously intended for 
another human being.

(Continue reading)

Frode | 21 Jan 01:09 2007
Picon

Re: Header documentation script


Hi!

18 jan 2007 kl. 06.17 skrev Vic Bancroft:

>> I've tried to look for it in the CVS repository but can't find  
>> any  obviously evidence of any such script. I have the feeling  
>> that for  some years ago I read about this somewhere and somehow,  
>> but can't  find it now.
>
> The winConfigure.pl script does several things; one of which is the  
> header file transformation,

Aha, that was the case...  :-)

> This a full filled example of what has been called 'literate  
> programming'   . . .
>
>    "The main idea is to treat a program as a piece of literature,
>    addressed to human beings rather than to a computer. The program is
>    also viewed as a hypertext document, rather like the World Wide  
> Web."    -- Knuth [1]
>
>> I'm asking because I thought about using the library's nice and   
>> gentle comment style in other projects, instead of the doxygen style.
>
> It is interesting the effect of text which is conciously intended  
> for another human being.

This was something interesting and news to me. One never stops to  
(Continue reading)


Gmane