Request Map

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 (e.g., use assoc), rather than constructing a new map entirely. Interceptors may add arbitrary keys to the request map, and the interceptors' functionality may depend on getting stored values back out of the request map.

Pedestal uses an extended version of the Ring request specification.

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 [1]. 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.

:headers

Y

Map of String → String

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

:path-info

Y

String

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

:path-params

N

Map

Present after succesful routing, a map from keyword id to string value of path parameters defined by the route.

:protocol

Y

String

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

: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

Keyword

The HTTP verb used to make this request, lowercased and in keyword form. Due to verb smuggling, this may change during processing of the request.

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

: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

Many more keys are added to the request map by the default interceptors, many of the new keys are related to parsing query parameters and the request body; this is described more fully in the parameters reference.


1. May not be set automatically by some chain providers (i.e., such as the AWS API Gateway provider).