[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTP Request/Response questions

From: Andy Wingo
Subject: Re: HTTP Request/Response questions
Date: Mon, 09 Jan 2012 20:16:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

On Sun 06 Nov 2011 12:18, Ian Price <address@hidden> 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 ""
>> #: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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]