Map Local feature lets you to serve any local file as the response of an intercepted request in realtime. You can make changes in the file locally and test them live without updating them on the server. when a request is made to a URL that matches a defined rule, Requestly intercepts the request and serves the specified local file as the response to the client, just as if it was the normal remote response. Making it ideal for testing different scenarios.
How to use?
Map Local feature is currently only supported in the Requestly Desktop app.
You can use the Redirect rule to map a request to a local file. This redirects the request to the local file, causing it to be served in response to that request.
Popular Use Cases
- Test local changes directly on production sites. This saves a lot of effort from deploying code to staging/production environment. Using Requestly, you can load CSS, images, JavasScript, assets etc. in staging/production (or live) sites to test your local changes faster.
In this example we'll create a rule, by utilizing Requestly's map local feature, we'll try to hit an external API endpoint which will intercept and redierct this request to the local file which we will be served as a respone to the client instead of what was intended from the production server.
Consider this as the content of local file :
"name": "John Doe",
"email": "[email protected]"
"message": "Failed to retrieve data"
"message": "Request timed out"
- Create a redirect rule and change the destination type to
- Add the source condition (the request URL which matches the source condition) and choose the local file to which you want to redirect to.
- Now the request to source URL we added will be intercepted and redirect to the local file we chose
The local file to which you want to redirect the request to, must be present in your local machine.