Modify Response - FAQs
Everything you need to know so you can modify response like a pro
Chrome Extension only supports modification of API responses triggered by XMLHttpRequest (XHR) or fetch. Requests made by jQuery AJAX or Axios is also supported in the Chrome extension. For any other resource type like HTML, JS you can use the desktop app.
We use request URL matching pattern. You can set the request URL to match, contain some specific expression or a regex expression to target a particular API. Read more here
Yes, you can get more control by using the source filter where you can specify which resource type or request method to target. GraphQL APIs can be targetted with request payload.

Source filters
Yes. It can be done very easily using the Requestly Desktop App. You just have to mention the status code you want to simulate in the modify response rule. Refer the demo here.

It can also be done using the requestly browser extension by using a redirect rule to redirect the actual request to a mock API which returns the desired status code. Read more here.
No, you can only get the request headers in JS mode but cannot modify them. To modify headers, modify headers rule should be used.
Response can be modified by sending a JSON or by programatically modifying the response using Javascript.
Desktop app also offers the capability to serve response JSON from a local file on your system.

Serving from local file
When modifying the response, users try assigning to a constant variable which is not allowed.
Developer tools can be toggled in the desktop app from the view menu. Logs can be checked in the devtool's console.

Toggling devtools
Yes
Yes graphql API requests can be targeted using the
request payload
source filter in the modify response rule. Read moreLast modified 11mo ago