Skip to main content

Quirks of modify rules

note

This functionality is only available on paid plans. Check our plans here.

A modify rule does not force you to change every aspect of a request. Each field can be left alone, and an empty one means "keep whatever the server said".

Status code​

Leave the Status code field empty and the rule forwards the status the server actually returned. The field says so with an Original chip instead of showing you a blank box:

a modify rule forwarding the original status

Click into the field and the chip steps aside, ready for a code to type. Empty it again and the chip comes back. A rule switched to Modify while it still carried the mock default of 200 is moved onto this behaviour for you, so a fresh modify rule does not silently overwrite every response status with a 200.

note

This is Modify only. A mock rule replaces the server entirely, so its status code is required.

Older versions of tweak spelled this as a literal 0 in the field. A rule saved back then still works, and now renders as Original.

Response payload​

If you only want to modify the response header of a request, you can do so by leaving the response payload and response hook tab empty.

Request payload​

A modify rule is a superset of a mock rule. The behavior of a mock rule can be achieve with a modify rule but not vice-versa. The "replace by" editor field in this rule can remain empty if you don't intend to modify the HTTP request payload.



Was this page helpful?

Need something else? Request a feature