Skip to main content

Request payload

The request payload has different UIs depending on the rule type.

Mock rules

The request payload acts as a filter to intercept the intended requests. This data is not sent out to the server.

For example, you can combine URL and request payload to target a specific POST request and configure more granular rules. This is useful when all APIs are behind the same endpoint and the request payload is the only variant (e.g. GraphQL).

default behavior

When creating a new rule the request payload is empty by default.

request payload with a mock rule

caution

When you leave the request payload empty, all requests are intercepted, regardless of the request body. This is valid for mock and modify rules.

Modify rules

note

Modify rules are only available on paid plans. Check our plans here.

With modify rules you can also specify a request payload to replace the original. tweak will replace this data on the fly, before the request leaves the browser.

request payload with a modify rule

In the above image, the request payload { "id": 200 } is going to be replaced by { "id": 202 }. If you open the devtools you can see the modified data.

Additional features

  1. You can reference variables and use data generators in this editor.
  2. By default tweak looks for a strict match in the request payload. You can relax the matching criteria. Read more here.


Was this page helpful?