IG 2023.6

Requests and responses

Request

An HTTP request message. Access the content of the request by using expressions.

Properties

"method": java.lang.String

The HTTP method; for example, GET.

"uri": java.net.URI

The fully-qualified URI of the resource being accessed; for example, http://www.example.com/resource.txt.

"version": java.lang.String

The protocol version used for the request; for example, HTTP/2.

"headers": org.forgerock.http.protocol.Headers

One or more headers in the request, with the format header_name: [ header_value, …​ ]. The following example accesses the first value of the request header UserId:

pass:[${request.headers['UserId'][0]}
"cookies": org.forgerock.http.protocol.RequestCookies

Incoming request cookies, with the format cookie_name: [ cookie_value, …​ ]. The following example accesses the first value of the request cookie my-jwt:

pass:[${request.cookies['my-jwt'][0].value}
"entity": Entity

The message body. The following example accesses the subject token from the request entity:

pass:[#{request.entity.form['subject_token'][0]}]
"queryParams": Form

Returns a copy of the query parameters decoded as a form. Modifications to the returned form are not reflected in the request.

Response

An HTTP response message. Access the content of the response by using expressions.

Properties

"cause": java.lang.Exception

The cause of an error if the status code is in the range 4xx-5xx. Possibly null.

"status": Status

The response status.

"version": java.lang.String

The protocol version used the response; for example, HTTP/2.

"headers": org.forgerock.http.protocol.Headers

One or more headers in the response. The following example accesses the first value of the response header Content-Type:

pass:[${response.headers['Content-Type'][0]}]
"trailers": org.forgerock.http.protocol.Headers

One or more trailers in the response. The following example accesses the first value of the response trailer Content-Length:

pass:[${response.trailers['Content-Length'][0]}]
"entity": Entity

The message entity body. The following example accesses the user ID from the response:

pass:[#{toString(response.entity.json['userId'])}]

Status

An HTTP response status.

Properties

"code": integer

Three-digit integer reflecting the HTTP status code.

"family": enumeration

Family Enum value representing the class of response that corresponds to the code:

Family.INFORMATIONAL

Status code reflects a provisional, informational response: 1xx.

Family.SUCCESSFUL

The server received, understood, accepted and processed the request successfully. Status code: 2xx.

Family.REDIRECTION

Status code indicates that the client must take additional action to complete the request: 3xx.

Family.CLIENT_ERROR

Status code reflects a client error: 4xx.

Family.SERVER_ERROR

Status code indicates a server-side error: 5xx.

Family.UNKNOWN

Status code does not belong to one of the known families: 600+.

"reasonPhrase": string

The human-readable reason-phrase corresponding to the status code.

"isClientError": boolean

True if Family.CLIENT_ERROR.

"isInformational": boolean

True if Family.INFORMATIONAL.

"isRedirection": boolean

True if Family.REDIRECTION.

"isServerError": boolean

True if Family.SERVER_ERROR.

"isSuccessful": boolean

True if Family.SUCCESSFUL.

URI

Represents a Uniform Resource Identifier (URI) reference.

Properties

"scheme": string

The scheme component of the URI, or null if the scheme is undefined.

"authority": string

The decoded authority component of the URI, or null if the authority is undefined.

Use "rawAuthority" to access the raw (encoded) component.

"userInfo": string

The decoded user-information component of the URI, or null if the user information is undefined.

Use "rawUserInfo" to access the raw (encoded) component.

"host": string

The host component of the URI, or null if the host is undefined.

"port": number

The port component of the URI, or null if the port is undefined.

"path": string

The decoded path component of the URI, or null if the path is undefined.

Use "rawPath" to access the raw (encoded) component.

"query": string

The decoded query component of the URI, or null if the query is undefined.

The query key and value is decoded. However, because a query value can be encoded more than once in a redirect chain, even though it is decoded it can contain unsafe ASCII characters.

Use "rawQuery" to access the raw (encoded) component.

"fragment": string

The decoded fragment component of the URI, or null if the fragment is undefined.

Use "rawFragment" to access the raw (encoded) component.

Copyright © 2010-2023 ForgeRock, all rights reserved.