guile-user
[Top][All Lists]
Advanced

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

Re: Using guile's web client


From: Chris Vine
Subject: Re: Using guile's web client
Date: Thu, 15 Mar 2012 10:40:38 +0000

On Thu, 15 Mar 2012 01:14:31 +0000
Ian Price <address@hidden> wrote:
[snip]
> It's actually debatable whether or not this is your fault :). http-get
> returns 2 values: the response and the body. When you call
> read-response-body on the port, you are trying to read information
> that has already been read, and so it is coming up with an
> (eof-object) rather than the body. However, I notice that the manual
> doesn't actually say that it returns two values, so that'll need to
> be fixed.

Ah thanks, that's great.  My "fault" was in assuming that in the absence
of documentation, the http-get procedure does what is "obvious" (ie what
other similar high-level http libraries do) and leaves the reading of
the body to read-response-body.  I have now looked at the source for
the web module and that reveals all.

It also follows then that I don't need the keep-alive on the http-get
procedure call.

A version of read-response-body which reads what's available would be
handy, so that data could be read as it comes in if you are using guile
with an event loop, say via guile's select procedure (I couldn't see
one but I may well have missed it). That is obviously irrelevant to my
toy trial.

Chris



reply via email to

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