From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sunjoong Lee Newsgroups: gmane.lisp.guile.user Subject: read-response-body of (web response) depends on Content-Length but ... Date: Fri, 27 Apr 2012 17:04:16 +0900 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6dab0e744998204bea48e93 X-Trace: dough.gmane.org 1335513890 21530 80.91.229.3 (27 Apr 2012 08:04:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 Apr 2012 08:04:50 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Apr 27 10:04:49 2012 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SNgAa-0003F3-J5 for guile-user@m.gmane.org; Fri, 27 Apr 2012 10:04:48 +0200 Original-Received: from localhost ([::1]:46249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNgAZ-0002EH-S1 for guile-user@m.gmane.org; Fri, 27 Apr 2012 04:04:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNgAT-0002EC-Se for guile-user@gnu.org; Fri, 27 Apr 2012 04:04:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNgAR-0001tp-VB for guile-user@gnu.org; Fri, 27 Apr 2012 04:04:41 -0400 Original-Received: from mail-wg0-f49.google.com ([74.125.82.49]:58947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNgAR-0001ri-MF for guile-user@gnu.org; Fri, 27 Apr 2012 04:04:39 -0400 Original-Received: by wgbds1 with SMTP id ds1so309013wgb.30 for ; Fri, 27 Apr 2012 01:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=LpID8CaYmD6qb4Xe5Z7CIXhh2fhJRYRIHFIWeVL9hps=; b=cSuuUhm32K7c5pelfrFXETlg6cxDYrtuYHvj92dHRzrAeQ07PslNq7KRJaLYDGD0Cv MEdlZRUSQlsSe/giiirWikBt9zRhQjKVg9y798E0+5bCMnNRcUCR1YExk2K6IEcwi4PJ ahE7Y8C79iR0yXJR1WTNPR2CauDxLtfvh9O1iEOvCYrcPOOHB2/IThZRannaLGQ53DKo eiw+C6FrBeQ80bCLe/+TP/YqhLzRgOP5l5mP8eNhzZpAxiqspQjXtMnxV+y0MfTqsAmh lUq+TB6bRHXuY1+4NlnFNWDEPvI+60KuOAysjzAujSJqQanFK50QUnyUF8ILflrHTGey 9bzA== Original-Received: by 10.216.141.134 with SMTP id g6mr6268730wej.12.1335513877616; Fri, 27 Apr 2012 01:04:37 -0700 (PDT) Original-Received: by 10.223.93.206 with HTTP; Fri, 27 Apr 2012 01:04:16 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9402 Archived-At: --0016e6dab0e744998204bea48e93 Content-Type: text/plain; charset=UTF-8 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; #< version: (1 . 1) code: 200 reason-phrase: "OK" headers: ((date . #) (server . "Apache/2.2.14") (accept-ranges bytes) (cache-control (max-age . 0)) (expires . #) (vary accept-encoding) (connection close) (transfer-encoding (chunked)) (content-type text/html) (content-language "en")) port: #> 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. --0016e6dab0e744998204bea48e93 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello,

I cannot solve=C2=A0http://lists.gnu.org/arch= ive/html/guile-user/2012-04/msg00034.html yet. This is a potentially re= lated problem but I'm not sure;

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

Above code display only false value, #f. After changing res-body to=C2=A0re= s-headers, it display;
=C2=A0 #<<response> version: (1 .= 1) code: 200 reason-phrase: "OK" headers: ((date . #<date nan= osecond: 0 second: 42 minute: 50 hour: 7 day: 27 month: 4 year: 2012 zone-o= ffset: 0>) (server . "Apache/2.2.14") (accept-ranges bytes) (c= ache-control (max-age . 0)) (expires . #<date nanosecond: 0 second: 42 m= inute: 50 hour: 7 day: 27 month: 4 year: 2012 zone-offset: 0>) (vary acc= ept-encoding) (connection close) (transfer-encoding (chunked)) (content-typ= e text/html) (content-language "en")) port: #<closed: file 0&g= t;>

Oh,=C2=A0Content-Length missing!!=C2=A0Apache server of= =C2=A0www.gnu.org replied response witho= ut Content-Length via home.en.html request. Is Content-Length=C2=A0mandator= y of=C2=A0response? If so, it would be Apache's fault. But if not so, I= think it's better modify=C2=A0read-response-body of (web response) in = Guile.

Thanks.
--0016e6dab0e744998204bea48e93--