[web-devel] Lazy simpleHTTP

Henning Thielemann lemming at henning-thielemann.de
Thu Nov 27 17:30:38 EST 2008


I have HTTP-3001.0.4 and I like to check the HTTP response headers before 
downloading the entire document. I hesitate to do a HEAD request first and 
then a separate GET request, because there is a (little, but not zero) 
chance, that the document changes between both requests. I hoped that 
simpleHTTP is lazy enough, so that I can check the rspHeaders field of the 
HTTP response and that only touching rspBody would download the document 
content. Unfortunately simpleHTTP downloads the entire document before I 
can access the HTTP header. To be honest, I would also like to fetch the 
content of the document lazily. Actually, if simpleHTTP would behave lazy, 
I suspect this requires using unsafeInterleaveIO internally, which is 
considered a hack. Is this the reason why simpleHTTP is not lazy? Or do I 
just need a lazy Stream type for this purpose?


More information about the web-devel mailing list