[plt-scheme] getting webserver URL arguments

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Wed Apr 6 05:54:19 EDT 2005

--- Stephen DeGabrielle <spdegabrielle at gmail.com> wrote:
> If anyone could point me to an example of a plt servlet
> getting an arg
> from the calling url (that is generated elsewhere - 
> getting the arguments from an http-get)

I stopped going with what I thought worked, and
investigated what actually did work.  A working servlet is
below.  I get the impression that nobody develops module
based servlets, as the documentation omits that you need to
require servlet-sig.ss to get request-bindings.   The
online documentation also doesn't mention the helper
procedures are in servlet-helpers.ss


(module stephen mzscheme

  (require (lib "servlet.ss" "web-server")
           (lib "servlet-sig.ss" "web-server")
           (lib "servlet-helpers.ss" "web-server"))

  (provide interface-version timeout start)

  (define interface-version 'v1)
  (define timeout +inf.0)
 ; start : request -> response
  (define (start initial-request)
    `(html (head (title "A Test Page"))
           (body ([bgcolor "white"])
                 (p ,@(extract-bindings


Email: noelwelsh <at> yahoo <dot> com
AIM: noelhwelsh

Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second dates. 

Posted on the users mailing list.