Skip to main content

Mock and modify rules

That are two types of rules that you can setup with tweak: mock and modify.

Mock rule

This is the default option and the only one available in the free version. In a mock rule, the intercepted request never leaves the browser and the extension fully replaces the server.

How it works

tweak intercepts the request from the application, applies the settings, and forwards the response back to the application.

Advantages

  1. You can hit the fake server as many times as you want, without being concerned of overloading a service or polluting the server logs with test data.
  2. Instant feedback: if you use the delay field with a value of 0, requests are instant, even when working with a slow network.
  3. You can work offline, if your application runs locally.

Modify rule

note

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

Modify rules allow you to tap into a HTTP request and modify it. They offer a broader range of capabilities compared to mock rules. In fact, a modify rule could do exactly what a mock rule does, but not vice-versa.

What can be modified:

  • Request payload
  • Request headers

modify rule interface changes

Here's what you can do with the response data and headers:

  • Response data
    • Forward the original response to the client.
    • Use custom JavaScript code to modify a single data property of the server response.
    • Re-write the entire response in the response payload tab.
  • Response headers
    • You can append additional response headers.
    • You can override the server's response headers.


Was this page helpful?