{"size": 2157, "ext": "scrbl", "max_stars_repo_path": "web-server-doc/web-server/scribblings/lang.scrbl", "max_stars_repo_name": "jessealama/web-server", "max_stars_repo_stars_event_min_datetime": "2015-01-21T08:11:58.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T08:28:39.000Z", "max_issues_repo_path": "web-server-doc/web-server/scribblings/lang.scrbl", "max_issues_repo_name": "jessealama/web-server", "max_issues_repo_issues_event_min_datetime": "2015-01-14T08:06:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-12T14:38:40.000Z", "max_forks_repo_path": "web-server-doc/web-server/scribblings/lang.scrbl", "max_forks_repo_name": "jessealama/web-server", "max_forks_repo_forks_event_min_datetime": "2015-03-05T15:07:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-30T18:59:25.000Z"}
{"max_stars_count": 82, "max_issues_count": 105, "max_forks_count": 37, "avg_line_length": 36.5593220339, "max_line_length": 107, "alphanum_fraction": 0.6629578118}
#lang scribble/doc
@(require "web-server.rkt")

@title[#:tag "lang/web"]{Stateless Web Interaction}

@(require (for-label net/url
                     xml
                     web-server/lang/web
                     racket
                     web-server/http))

@defmodule[web-server/lang/web]{

@defproc[(send/suspend/url [response-generator (url? . -> . response?)])
         request?]{
 Captures the current continuation. Serializes it and stuffs it into
 a URL. Calls @racket[response-generator] with this URL and delivers
 the response to the client. If the URL is invoked
 the request is returned to this continuation.
}
                  
@defproc[(send/suspend [response-generator (string? . -> . response?)])
         request?]{
 Like @racket[send/suspend/url] but with a string URL representation.
}

@defproc[(send/suspend/hidden [response-generator (url? xexpr/c . -> . response?)])
         request?]{
 Captures the current continuation. Serializes it and stuffs it into a hidden INPUT
 form element.
 Calls @racket[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.
}

@defproc[(send/suspend/url/dispatch [make-response (((request? . -> . any) . -> . url?) . -> . response?)])
         any]{
 Calls @racket[make-response] with a function that, when called with a procedure from
 @racket[request?] to @racket[any/c] will generate a URL, that when invoked will call
 the function with the @racket[request?] object and return the result to the caller of
 @racket[send/suspend/dispatch].
}
               
@defproc[(send/suspend/dispatch [make-response (((request? . -> . any) . -> . string?) . -> . response?)])
         any]{
 Like @racket[send/suspend/url/dispatch] but with a string URL representation.
}


@defproc[(redirect/get [#:headers hs (listof header?) empty]) request?]{
See @racketmodname[web-server/servlet/web].

  @history[#:changed "1.3"
           @elem{Added @racket[hs] argument and
              changed to use @racket[see-other] instead of @racket[temporarily].}]
 }
}
