unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* A question about http-get of (web client)
@ 2012-04-26  1:15 Sunjoong Lee
  2012-04-26 12:50 ` Sunjoong Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Sunjoong Lee @ 2012-04-26  1:15 UTC (permalink / raw)
  To: guile-user

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

First, here is an example of http-get:

  (use-modules ((web uri)    #:select (string->uri))
               ((web client) #:select (http-get)))
  (call-with-values (lambda ()
                      (http-get
                       (string->uri "http://www.gnu.org/software/guile/")))
    (lambda (res-headers res-body)
      (display res-body)
      (newline)))

It works well. But after changing url string from "
http://www.gnu.org/software/guile/" to "http://www.gnu.org/", it did not
work. Last two lines of Backtrace is:
  web/http.scm:184:11: In procedure read-header:
  web/http.scm:184:11: Throw to key `bad-header' with args `(uri
"home.html")'.

I think http://www.gnu.org/ need to know browser's encoding language.
http-get accept extra-headers but I don't know how to fill the contents of
headers in web and scheme. In scheme, I think acon magic(?) is needed.
Please show me an example to fill headers. I want to fill browser's
encoding language, browser's type and some cookies. Oh, cookie would be
need if  http://www.google.com/ , I think, and would be got
from res-headers.

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

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-26  1:15 A question about http-get of (web client) Sunjoong Lee
2012-04-26 12:50 ` Sunjoong Lee
2012-04-27 14:20   ` Sunjoong Lee

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