Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 2.54 KB

transform-query-parameters.md

File metadata and controls

68 lines (48 loc) · 2.54 KB
description
This page provides the technical details of the Transform Query Parameters policy

Transform Query Parameters

Overview

You can use the transformqueryparams policy to override incoming HTTP request query parameters. You can override the HTTP query parameters by:

  • Clearing all existing query parameters
  • Adding to or updating the list of query parameters
  • Removing query parameters individually

The query parameter values of the incoming request are accessible via the {#request.params['query_parameter_name']} construct.

Functional and implementation information for the transformqueryparams policy is organized into the following sections:

Examples

{% hint style="warning" %} This policy can be applied to v2 APIs and v4 proxy APIs. It cannot be applied to v4 message APIs. {% endhint %}

{% tabs %} {% tab title="Proxy API example" %} The example below shows how to add the ID of the incoming request to the outgoing request:

"transform-queryparams": {
    "addQueryParameters": [
        {
            "name": "myParam",
            "value": "{#request.id}"
        }
    ],
    "removeQueryParameters": [
        "secretParam"
    ]
}

{% endtab %} {% endtabs %}

Configuration

Phases

The phases checked below are supported by the transformqueryparams policy:

v2 PhasesCompatible?v4 PhasesCompatible?
onRequesttrueonRequesttrue
onResponsefalseonResponsefalse
onRequestContentfalseonMessageRequestfalse
onResponseContentfalseonMessageResponsefalse

Compatibility matrix

The following is the compatibility matrix for APIM and the transformqueryparams policy:

Plugin VersionSupported APIM versions
1.xAll

Changelogs

{% @github-files/github-code-block url="https://github.com/gravitee-io/gravitee-policy-transformqueryparams/blob/master/CHANGELOG.md" %}