chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] http and spiffy: how to add a GET-able resource


From: Dan
Subject: [Chicken-users] http and spiffy: how to add a GET-able resource
Date: Wed, 19 Apr 2006 03:22:06 -0700 (PDT)

Hi all,

I tried to modify the Hello World example on spiffy's
page
(http://www.call-with-current-continuation.org/eggs/spiffy.html)
to print GET parameters; however, when I try to access
localhost:4242/index.html&x=y, spiffy sends a "Sorry,
your request could not be handled" page.

What should I tell http:add-resource to make it handle
the extra GET parameters? I tried changing the handler
URL to "/index.html*" but that didn't change anything.
Please document this in the http or spiffy egg
homepages.

(http:add-resource
  "/index.html"
  (lambda (request args)
    (http:write-response-header)
    (let ((name (car (user-information
                       (current-user-id)))))
      (let ((s (sprintf
                "<h1>Hello, ~A</h1>~A"
                name args)))
        (printf "Content-length: ~A\r\nContent-type:
text/html\r\n\r\n~A" 
          (string-length s) s)))))

-- Dan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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