Map Local (File)
Map a file as a response of requests
Last updated
Map a file as a response of requests
Last updated
The Map Local Tool enables you to use the content of local files as an HTTP Response to your requests.
You can do Map Local for GraphQL with the Scripting Tool (Snippet Code)
You can combine Map Local with Breakpoint to modify the content on the fly (2.16.0+)
Define a Response with Status Code, Headers, and Body -> Mock to a given Request -> Easily to test some edge cases without waiting for the server's update.
Mock Fake API with a local File: It's useful for developers to try out the testing APIs that are not in production.
Right Click on your request on the main table -> Tools -> Map Local -> Proxyman will automatically create a new rules with a current Response
Feel free to change the Status Code, Headers and the JSON Body
Done
Re-sent your request -> New Response is mapped.
Click on the Select Local File
button and select any files. Supports: Text, JSON, Binary, Image
It's useful to map to a given file and able to provide the Status Code and Response Headers.
Work with JSON, Text, Binary, Image etc
Make sure to provide Content-Type
header, so your client can work properly
Right-click on the Request (which already has a Response) -> Tools -> Map Local. Proxyman will create a rule with the current Response Body (The file is stored in your Desktop folder)
We can directly change the Response body.
Make a request and observe the new Response Body.
From Proxyman 2.27.0+, Map Local can work with GraphQL Request by a specific QueryName. Please check out the following GraphQL Document.
If you would like to do Map Local with complicated rules, you might check out Scripting since it's easier to achieve the same result.
Please check out these Snippet Code to understand how to map a local file with Javascript Code.