On Sun 06 Nov 2011 12:18, Ian Price <ianpric...@googlemail.com> writes:
> I have a patch to deal with this, but I have not received any > feedback on my proposed functions, so I haven't posted it > yet. Basically, I wanted to add 4 functions, including a > read-chunked-response-body, and to have the (web client) handle > chunked-encoding transparently. How about not exporting read-chunked-response-body, but instead having read-response-body check for chunked encoding itself? >> (define request (build-request (build-uri 'http #:host "rss.slashdot.org" >> #:path "/Slashdot/slashdot"))) >> (write-request request port) >> (define response (read-response port)) >> >> I get the following error when reading the response: >> >> web/http.scm:814:12: In procedure parse-entity-tag: >> web/http.scm:814:12: Throw to key `bad-header' with args `(qstring >> "F+oOJMkOlp2n1IUbAJmq+7qCGuk")'. > I came across this issue already, and in my case it was because some servers > (gws, I think) don't quote their Etags. Feedburner was a common > culprit. All in all, not common, but a nuisance. Using 'declare-header!' > from the (web http) library, you can cause Etags not to be parsed by doing > > (declare-header! "Etag" values string? display) Should we fix the etag parser to allow unquoted strings? > Although, I'd think it much nicer if guile were to expose > declare-opaque-header! directly for these sorts of circumstances. If you document it, sure. Cheers, Andy -- http://wingolog.org/