unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* read-response-body of (web response) depends on Content-Length but ...
@ 2012-04-27  8:04 Sunjoong Lee
  2012-04-27  8:28 ` Sunjoong Lee
  0 siblings, 1 reply; 6+ messages in thread
From: Sunjoong Lee @ 2012-04-27  8:04 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

Hello,

I cannot solve
http://lists.gnu.org/archive/html/guile-user/2012-04/msg00034.html yet.
This is a potentially related problem but I'm not sure;

(use-modules ((srfi srfi-11) #:select (let-values))
             ((web uri)      #:select (string->uri))
             ((web client)   #:select (http-get)))
(let-values (((res-headers res-body)
              (http-get (string->uri "http://www.gnu.org/home.en.html"))))
  (display res-body)
  (newline))

Above code display only false value, #f. After changing res-body
to res-headers, it display;
  #<<response> version: (1 . 1) code: 200 reason-phrase: "OK" headers:
((date . #<date nanosecond: 0 second: 42 minute: 50 hour: 7 day: 27 month:
4 year: 2012 zone-offset: 0>) (server . "Apache/2.2.14") (accept-ranges
bytes) (cache-control (max-age . 0)) (expires . #<date nanosecond: 0
second: 42 minute: 50 hour: 7 day: 27 month: 4 year: 2012 zone-offset: 0>)
(vary accept-encoding) (connection close) (transfer-encoding (chunked))
(content-type text/html) (content-language "en")) port: #<closed: file 0>>

Oh, Content-Length missing!! Apache server of www.gnu.org replied response
without Content-Length via home.en.html request. Is
Content-Length mandatory of response? If so, it would be Apache's fault.
But if not so, I think it's better modify read-response-body of (web
response) in Guile.

Thanks.

[-- Attachment #2: Type: text/html, Size: 1862 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-27 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-27  8:04 read-response-body of (web response) depends on Content-Length but Sunjoong Lee
2012-04-27  8:28 ` Sunjoong Lee
2012-04-27 10:00   ` Sunjoong Lee
2012-04-27 11:08     ` Sunjoong Lee
2012-04-27 12:35       ` Sunjoong Lee
2012-04-27 11:32   ` Daniel Hartwig

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).