The Web Server provides a simple utility library for building Web applications that consist mostly of send/suspend/dispatch -created pages and request handling.
....(my-embed/urlother-page)....))
syntax
( page e...)
syntax
(page`(html(body(a([href"You clicked!"))])"Click me")))))
Similarly, many Web applications make use almost exclusively of functions that are arguments to embed/url and immediately invoke send/suspend/dispatch .
syntax
( lambda/page formalse...)
syntax
( define/page (id. formals)e...)
The binding interface of web-server/http is powerful, but subtle to use conveniently due to its protection against hostile clients.
value
value
procedure
( get-binding id[req#:formatformat])
id:binding-id/cprocedure
( get-bindings id[req#:formatformat])
id:binding-id/c
get-binding extracts the first binding of a form input from a request, while get-bindings extracts them all.
They accept a form identifier (id) as either a byte string, a string, or a symbol. In each case, the user input is compared in a case-sensitive way with the form input.
They accept an optional request argument (req) that defaults to the value of the current-request parameter used by lambda/page and define/page .
Finally, they accept an optional keyword argument (format) that specifies the desired return format. The default, 'string, produces a UTF-8 string (or #f if the byte string cannot be converted to UTF-8.) The 'bytes format always produces the raw byte string. The 'file format produces the file upload content (or #f if the form input was not an uploaded file.) The 'binding format produces the binding object.