Policies

Add or Set Query Parameters Policy

Adds or sets query parameters on the incoming request.

Configuration

The configuration shows how to configure the policy in the 'policies.json' document.

{ "name": "my-set-query-params-inbound-policy", "policyType": "set-query-params-inbound", "handler": { "export": "SetQueryParamsInboundPolicy", "module": "$import(@zuplo/runtime)", "options": { "params": [ { "name": "my-key", "value": "my-value" } ] } } }

Policy Options

The options for this policy are specified below. All properties are optional unless specifically marked as required.

  • params <object[]> (Required) -
    An array of query params to set in the request. By default, query parameters will be overwritten if they already exist in the request, specify the overwrite property to change this behavior.
    • name <string> (Required) -
      The name of the param.
    • value <string> (Required) -
      The value of the param.
    • overwrite <boolean> -
      Overwrite the value if the param is already present in the request.
      Defaults to true.

Using the Policy

Read more about how policies work

Previous
Set Body