---
title: StaticRequestFilter
description: Creates a new request, replacing any existing request. The request can include an entity specified in the entity parameter. Alternatively, the request can include a form, specified in the form parameter, which is included in an entity encoded in application/x-www-form-urlencoded format if request method is POST, or otherwise as (additional) query parameters in the URI. The form and entity parameters cannot be used together when the method is set to POST.
component: pinggateway
version: 2026
page_id: pinggateway:reference:StaticRequestFilter
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/StaticRequestFilter.html
revdate: 2025-10-15T18:45:22Z
section_ids:
  StaticRequestFilter-usage: Usage
  StaticRequestFilter-properties: Properties
  StaticRequestFilter-example: Example
---

# StaticRequestFilter

Creates a new request, replacing any existing request. The request can include an entity specified in the `entity` parameter. Alternatively, the request can include a form, specified in the `form` parameter, which is included in an entity encoded in `application/x-www-form-urlencoded` format if request method is `POST`, or otherwise as (additional) query parameters in the URI. The `form` and `entity` parameters cannot be used together when the `method` is set to `POST`.

## Usage

```json
{
  "name": string,
  "type": "StaticRequestFilter",
  "config": {
    "method": configuration expression<string>,
    "uri": runtime expression<url>,
    "version": configuration expression<string>,
    "headers": {
      configuration expression<string>: [ runtime expression<string>, ... ], ...
    },
    "form": {
      configuration expression<string>: [ runtime expression<string>, ... ], ...
    },
    "entity": runtime expression<string>
  }
}
```

## Properties

* `"method"`: *configuration expression<[string](preface.html#definition-string)>, required*

  The HTTP method to be performed on the resource; for example, `GET`.

* `"uri"`: *runtime expression<[url](preface.html#definition-url)>, required*

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

  The result of the expression must be a string that represents a valid URI, but isn't a real `java.net.URI` object. For example, it would be incorrect to use `${request.uri}`, which is not a string but a mutable URI.

* `"version"`: *configuration expression<[string](preface.html#definition-string)>, optional*

  Protocol version.

  Default: `"HTTP/1.1"`

* `"headers"`: *[map](preface.html#definition-map), optional*

  One or more headers to set for a request, with the format `name: [ value, …​ ]`, where:

  * *name* is a configuration expression<[string](preface.html#definition-string)> that resolve to a header name. If multiple expressions resolve to the same final string, *name* has multiple values.

  * *value* is one or more runtime expression<[strings](preface.html#definition-string)> that resolve to header values.

  In the following example, the header name is the value of the system variable defined in `cookieHeaderName`. The header value is stored in `contexts.ssoToken.value`:

  ```json
  "headers": {
    "${application['header1Name']}": [
      "${application['header1Value'}"
    ]
  }
  ```

Default: Empty

* `"form"`: *[map](preface.html#definition-map), optional*

  A form to include in the request and/or `application/x-www-form-urlencoded` entity, as name-value pairs, where:

  * *name* is a configuration expression<[string](preface.html#definition-string)> that resolves to a form parameter name.

  * *value* is one or more runtime expression<[strings](preface.html#definition-string)> that resolve to form parameter values.

  When a Request `method` is `POST`, `form` is mutually exclusive with `entity`.

  Examples:

  * In the following example, the field parameter names and values are hardcoded in the form:

    ```json
    "form": {
      "username": [
        "demo"
      ],
      "password": [
        "password"
      ]
    }
    ```

  * In the following example, the values take the first value of `username` and `password` provided in the session:

    ```json
    "form": {
      "username": [
        "${session.username[0]}"
      ],
      "password": [
        "${session.password[0]}"
      ]
    }
    ```

  * In the following example, the name of the first field parameter takes the value of the expression `${application['formName']}` when it is evaluated at startup. The values take the first value of `username` and `password` provided in the session:

    ```json
    "form": {
      "${application['formName']}": [
        "${session.username[0]}"
      ],
      "${application['formPassword']}": [
        "${session.password[0]}"
      ]
    }
    ```

    Default: Empty

* `"entity"`: *runtime expression<[string](preface.html#definition-string)>, optional*

  The message entity body to include in a request.

  When a Request `method` is `POST`, `entity` is mutually exclusive with `form`.

  Methods are provided for accessing the entity as byte, string, or JSON content. Learn more in [Entity](../_attachments/apidocs/org/forgerock/http/protocol/Entity.html).

  |   |                                                                                                                                                                                                               |
  | - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  |   | Attackers during reconnaissance can use messages to identify information about a deployment. For security, limit the amount of information in messages, and avoid using words that help identify PingGateway. |

  Default: Empty

## Example

In the following example, PingGateway replaces the browser's original HTTP GET request with an HTTP POST login request containing credentials to authenticate to the sample application. Learn more in [Getting started with PingGateway](../getting-started/preface.html).

```json
{
  "handler": {
    "type": "Chain",
    "config": {
      "filters": [
        {
          "type": "StaticRequestFilter",
          "config": {
            "method": "POST",
            "uri": "https://app.example.com:8444/login",
            "form": {
              "username": [
                "demo"
              ],
              "password": [
                "Ch4ng31t"
              ]
            }
          }
        }
      ],
      "handler": "ReverseProxyHandler"
    }
  },
  "condition": "${find(request.uri.path, '^/static')}"
}
```

Source: [01-static.json](../_attachments/config/routes/01-static.json)
