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).
When creating a new rule the request payload is empty by default.

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​
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.

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 request payload.
Do you need more granularity on replacing the request payload? Use a "Request hook" instead.
Form request bodies​
A request whose Content-Type is application/x-www-form-urlencoded (a classic HTML form post, many
OAuth token endpoints) carries its body as name=Jon+Snow&house=Stark. Editing that as text is
error-prone, so tweak edits it as a key/value table instead: one row per field, already decoded.

The switch is the request's Content-Type. A strip above the request payload tab shows it (JSON,
Form URL-encoded, Plain text or None): pick Form URL-encoded and the editor becomes the
table. On a modify rule that strip is the very same Content-Type row you see in the
request headers tab, and it is sent with the request. On a mock rule it only
describes the request being answered.
When a form rule matches, the order of the fields does not matter: house=Stark&name=Jon+Snow
matches the table above. Partial matching works field by
field too. Leave the table empty to match any payload. Variables work in the cells, and a request picked from
request capture that was a form post arrives already as a table.
Additional features​
- You can reference variables and use data generators in this editor.
- By default tweak looks for a strict match in the request payload. You can relax the matching criteria. Read more here.
Need something else? Request a feature