On this page:
send/ suspend/ url
send/ suspend/ hidden
send/ suspend/ dispatch
Version: 4.1.2

3.4 Web

 (require web-server/lang/web)

"lang/web.ss" provides the most basic Web functionality.

(send/suspend/url response-generator)  request?
  response-generator : (url? . -> . response?)

Captures the current continuation. Serializes it and stuffs it into a URL. Calls response-generator with this URL and delivers the response to the client. If the URL is invoked the request is returned to this continuation.

(send/suspend/hidden response-generator)  request?
  response-generator : (url? xexpr? . -> . response?)

Captures the current continuation. Serializes it and generates an INPUT form that includes the serialization as a hidden form. Calls response-generator with this URL and form field and delivers the response to the client. If the URL is invoked with form data containing the hidden form, the request is returned to this continuation.

Note: The continuation is NOT stuffed.

(send/suspend/dispatch make-response)  any/c
  make-response : (embed/url/c . -> . response?)

Calls make-response with a function that, when called with a procedure from request? to any/c will generate a URL, that when invoked will call the function with the request? object and return the result to the caller of send/suspend/dispatch.