unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Chris Vine <chris@cvine.freeserve.co.uk>
To: Ian Price <ianprice90@googlemail.com>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: Using guile's web client
Date: Thu, 15 Mar 2012 10:40:38 +0000	[thread overview]
Message-ID: <20120315104038.7513d7c1@laptop.homenet> (raw)
In-Reply-To: <877gymr7go.fsf@Kagami.home>

On Thu, 15 Mar 2012 01:14:31 +0000
Ian Price <ianprice90@googlemail.com> 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	other threads:[~2012-03-15 10:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15  0:05 Using guile's web client Chris Vine
2012-03-15  1:14 ` Ian Price
2012-03-15 10:40   ` Chris Vine [this message]
2012-03-15 12:42     ` Ian Price
2012-03-15  1:43 ` Nala Ginrut
2012-03-15  2:11   ` Ian Price
2012-03-15  3:55     ` Nala Ginrut
2012-03-15  4:01       ` Nala Ginrut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120315104038.7513d7c1@laptop.homenet \
    --to=chris@cvine.freeserve.co.uk \
    --cc=guile-user@gnu.org \
    --cc=ianprice90@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).