From: Matt Wette <matt.wette@gmail.com>
To: Chris Vine <vine35792468@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: http response: can't read body
Date: Mon, 23 Oct 2017 05:29:54 -0700 [thread overview]
Message-ID: <B0672B75-11DF-47C6-B74B-E643FB3D46AD@gmail.com> (raw)
In-Reply-To: <20171023103632.571d0c36@bother.homenet>
> On Oct 23, 2017, at 2:36 AM, Chris Vine <vine35792468@gmail.com> wrote:
>
> 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
>
Thanks. Second value is a bytevector. -- Matt
next prev parent reply other threads:[~2017-10-23 12:29 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
2017-10-23 12:29 ` Matt Wette [this message]
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=B0672B75-11DF-47C6-B74B-E643FB3D46AD@gmail.com \
--to=matt.wette@gmail.com \
--cc=guile-user@gnu.org \
--cc=vine35792468@gmail.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).