Policies

Set Body Policy

The Set Body policy allows you to set or override the incoming request body. GET or HEAD requests do not support bodies on Zuplo, so be sure to use the Change Method policy to update the method to a POST or whatever is appropriate. You might also need to use the Set Header policy to set a content-type.

Configuration

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

{ "name": "my-set-body-inbound-policy", "policyType": "set-body-inbound", "handler": { "export": "SetBodyInboundPolicy", "module": "$import(@zuplo/runtime)", "options": { "body": "Hello World!" } } }

Policy Options

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

  • body <string> (Required) -
    The value to set for the body.

Using the Policy

Read more about how policies work

Previous
Add or Set Request Headers