On this page:
2.6.1 Low Level
send/ suspend
2.6.2 High Level
send/ suspend/ url
send/ suspend/ hidden
send/ suspend/ dispatch
redirect/ get
2.6.3 Stuff URL
stuff-url
stuffed-url?
unstuff-url
Version: 4.1.3

2.6 Stateless Web Interaction

2.6.1 Low Level

 (require web-server/lang/abort-resume)

(send/suspend response-generator)  any
  response-generator : (continuation? . -> . any)

Captures the current continuation in a serializable way and calls response-generator with it, returning the result.

2.6.2 High Level

 (require web-server/lang/web)

(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.

(redirect/get)  request?

See web-server/servlet/web.

2.6.3 Stuff URL

 (require web-server/lang/stuff-url)

"lang/stuff-url.ss" provides an interface for "stuffing" serializable values into URLs. Currently there is a particular hard-coded behavior, but we hope to make it more flexible in the future.

(stuff-url v u)  url?
  v : serializable?
  u : url?

Returns a URL based on u with v serialized and "stuffed" into it. The following steps are applied until the URL is short enough to be accepted by IE.

(stuffed-url? u)  boolean?
  u : url?

Checks if u appears to be produced by stuff-url.

(unstuff-url u)  serializable?
  u : url?

Extracts the value previously serialized into u by stuff-url.

In the future, we will offer the facilities to: