- request-vars #!key (source 'request-method) max-content-lengthprocedure
request-vars returns a procedure which can be used to access variables from the HTTP request. The returned procedure takes the name of the variable (either a symbol or a string) as argument. You can (optionally) also pass a converter procedure to be used as a type converter for the variable value (see Converter procedures) or a default value.
request-vars accepts some keyword arguments:
- source
- 'query-string tells request-vars to parse the query string only (for GET variables). 'request-body tells request-vars to parse the request body only (e.g., for POST variables). 'both tells request-vars to parse both the request body and the query string. 'request-method tells request-vars to parse only the source that matches the request method (e.g., for a GET request, only the query string will be read; for a POST request, only the request body will be read). The default value for source is 'request-method (since version 0.18 -- previous versions used 'both). Notice that when 'both is used, variables from the request body have precedence over the ones from the query string. Warning: using 'both as source for request-vars may be a security issue (see the release notes for version 0.18 for more details).
- max-content-length
- the maximum content length (in characters) to be read from the request body. Default is #f (no limit).