Pedestal

Request Map

Description

The request map is attached to the Context Map before the first interceptor is invoked. The request map describes the incoming HTTP request, including information about the remote endpoint.

Pedestal does not attach metadata to the request map.

When processing, take care to modify the map, rather than constructing a new one. Interceptors may add arbitrary keys to the request map.

Key Always Present? Type Description

:async-supported?

Y

boolean

True if this request supports asynchronous operation

:body

Y

ServletInputStream

The body of the request. May be a zero-length stream.

:content-type

N

String

Present if sent by client. Content type of the request body.

:content-length

N

Long

Present if sent by client. Content length of the request body.

:character-encoding

N

String

Present if sent by client. Character encoding applicable to request body.

:edn-params

N

Any

Present if the body-params interceptor is used and the client sent content type "application/edn"

:form-params

N

Map of keyword → String

Present if the body-params interceptor is used and the client sent content type "application/x-www-form-urlencoded". Some keys may be left as strings, if they contain characters that would make them invalid as Clojure keywords.

:headers

Y

Map of String → String

Request headers sent by the client. Header names are all converted to lower case.

:json-params

N

Map of String → String

Present if the body-params interceptor is used and the client sent content type "application/json"

:params

Y

Map of keyword or String → String

Merged map of path, query, and request parameters.

:path-info

Y

String

Request path, below the context path. Always at least "/", never an empty string.

:path-params

N

Map of keyword → String

Present if the router found any path parameters.

:protocol

Y

String

Name and version of the protocol with which the request was sent

:query-params

N

Map of keyword → String

Present if the query-params interceptor is used. (It is one of the default interceptors.)

:query-string

Y

String

The part of the request’s URL after the '?' character.

:remote-addr

Y

String

IP Address of the client (or the last proxy to forward the request)

:request-method

Y

String

The HTTP verb used to make this request, lowercased and in keyword form. For example, :get or :post. For :put and :delete request methods, this may be "smuggled" in via a query parameter :_method. (Performed by the method-param interceptor.

:server-name

Y

String

Host name of the server to which the request was sent

:server-port

Y

int

Port number to which the request was sent

:scheme

Y

String

The name of the scheme used to make this request, for example, http, https, or ftp.

:ssl-client-cert

N

java.security.cert.X509Certificate[]

Present if sent by client. Array of certificates that identify the client.

:transit-params

N

Any data structure

Present if the body-params interceptor is used and the client sent content type "application/transit+json" or "application/transit+msgpack"

:uri

Y

String

The part of this request’s URL from the protocol name up to the query string in the first line of the HTTP request