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.

Reply via email to