Getting Started
Getting Started
Installation
Installation
Inspect Traffic
Inspect Traffic
HTTP Rules (Modify Traffic)
HTTP Rules (Modify Traffic)
Overview
Request Modification — Redirect URL (Map Local, Map Remote)
Request Modification — Replace Strings (Switch Hosts, API Endpoints)
Request Modification — Modify Headers
Request Modification — Modify Request Body
Response Modification — Modify Response Body
Request Modification — Modify Query Params
Request Modification — Modify User Agents
Request Modification — Delay Request
Request Modification — Map Local
Request Modification — Map Remote
Response Modification — Modify DOM/Inject scripts
Response Modification — Cancel Rule
Predefined Functions
Organizing Rule — Grouping
Organizing Rule — Import/Export Rules from File
Organizing Rule — Pause/Resume Requestly
Organizing Rule — Rule Operators
Organizing Rule — Advance Targeting
Organizing Rule — Sharing Rules
Organizing Rule — Pinning Rules
GraphQL - Modify Request & Response
Import / Export — Charles Proxy Rules
Test Rules — Test URL Condition
Test Rules — Test this Rule
Session Book
Session Book
File Server
File Server
Public API
Public API
Guides
Guides
TroubleShooting
TroubleShooting
Subscription & Billing
Subscription & Billing
Getting Started
Getting Started
Installation
Installation
Inspect Traffic
Inspect Traffic
HTTP Rules (Modify Traffic)
HTTP Rules (Modify Traffic)
Overview
Request Modification — Redirect URL (Map Local, Map Remote)
Request Modification — Replace Strings (Switch Hosts, API Endpoints)
Request Modification — Modify Headers
Request Modification — Modify Request Body
Response Modification — Modify Response Body
Request Modification — Modify Query Params
Response Modification — Modify DOM/Inject scripts
Request Modification — Modify User Agents
Request Modification — Delay Request
Response Modification — Cancel Rule
Organizing Rule — Grouping
Organizing Rule — Import/Export Rules from File
Organizing Rule — Pause/Resume Requestly
Organizing Rule — Rule Operators
Organizing Rule — Advance Targeting
Organizing Rule — Sharing Rules
Request Modification — Map Local
Request Modification — Map Remote
Organizing Rule — Pinning Rules
GraphQL - Modify Request & Response
Import / Export — Charles Proxy Rules
Test Rules — Test URL Condition
Predefined Functions
Test Rules — Test this Rule
File Server
File Server
Public API
Public API
Guides
Guides
Session Book
Session Book
Subscription & Billing
Subscription & Billing
Map Local
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?
INFO
This feature is only available in Desktop App.
Download
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
- Testing Offline or Unavailable Resources: Map Local allows users to serve local HTML, CSS, JavaScript, or other static files as responses to requests for online resources. This can be useful when testing a web application offline or when certain resources are temporarily unavailable.
- 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, JavaScript, assets etc. in staging/production (or live) sites to test your local changes faster.
Example
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 :
{ "success": { "status": "success", "data": { "name": "John Doe", "age": 30, "email": "john.doe@example.com" } }, "error": { "status": "error", "message": "Failed to retrieve data" }, "timeout": { "status": "timeout", "message": "Request timed out" } }
- Create a redirect rule and change the destination type to
Local file
- 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.
Note The local file to which you want to redirect the request to, must be present in your local machine.
FAQs
Will this rule work in extension?
Due to technical constraints, this rule does not work in extension. But you can use the Desktop app to map local files in redirect rule.
Do I need to change rule after changing the contents of local file?
Requestly intercepts the request and serves the specified local file as the response to the client. This process happens in real-time, meaning that any changes made to the local file are immediately reflected in the responses served by Requestly, without needing to change the rule again.