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.

Reply via email to