unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Chris Vine <vine35792468@gmail.com>
To: guile-user@gnu.org
Subject: Re: http response: can't read body
Date: Mon, 23 Oct 2017 10:36:32 +0100	[thread overview]
Message-ID: <20171023103632.571d0c36@bother.homenet> (raw)
In-Reply-To: <A464DF71-CC19-460A-B6BC-119AEEA2C5EE@gmail.com>

On Sun, 22 Oct 2017 15:25:54 -0700
Matt Wette <matt.wette@gmail.com> wrote:
> I'm using Guile 2.2.2 web api and I can't get the body. 
> 
> I'm getting a response from (http-get <query>).
> The (response-code resp) is 200.
> The value I get back from (response-body-port resp) says #t for port?
> and input-port?
> 
> But if I try to read-char on the port I get:
> ERROR: In procedure get-bytevector-n!:
> ERROR: In procedure get-bytevector-n!: Wrong type argument in
> position 1 (expecting open input port): #<closed: string 106c24b60>
> 
> I get the same error if I use read-response-body.
> 
> What am I doing wrong?
> 
> Matt

I have only used http-get in non-streaming mode, but if you are
streaming with http-get as I read the documentation you do not use
response-body-port - that is for response objects returned by
read-response: instead you read the port returned by http-get as its
second value .

Chris



  reply	other threads:[~2017-10-23  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-22 22:25 http response: can't read body Matt Wette
2017-10-23  9:36 ` Chris Vine [this message]
2017-10-23 12:29   ` Matt Wette
2017-10-23 12:48     ` Chris Vine

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=20171023103632.571d0c36@bother.homenet \
    --to=vine35792468@gmail.com \
    --cc=guile-user@gnu.org \
    /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).