guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A question about http-get of (web client)


From: Sunjoong Lee
Subject: A question about http-get of (web client)
Date: Thu, 26 Apr 2012 10:15:44 +0900

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

[Prev in Thread] Current Thread [Next in Thread]