Snippet Code
The collection of useful snippet code for the Scripting tool
1. What's it?
2. Common on Request and Response
3. Addons
4. Regex
5. Import / Export Files
6. Miscellaneous
7. Encryption/Decryption
8. Map Remote with Scripting
9. Make Async/await HTTP Request (macOS)
9.1. Make Async/await HTTP Request (Windows/Linux)
10. URL and URLSearchParams
11. Access Environment Variables
Websocket
HTTP Header
Add/Update: Request or Response Header
Delete: Request or Response Header
Request Query
Add/Update
Delete
URLEncoded Form Body
Add/Update
Delete
Change Request Destination (scheme, host, port, path)
HTTP to HTTPS
HTTPS to HTTP
Change HTTP Request Method
Change Response HTTP Status Code
JSON Body
On Request
On Response
Map a local file to Response's Body like Map Local Tool (Proxyman 2.25.0+)
Use JSON File as a Body of Request or Response
Use multiple JSON files
Map Local with GraphQL
Use ArrayBuffer in Request/Response Body
Preserve the Host
Comment & Highlight with color

Import Files with require()
JSON

Binary File
Text-Based File
Import File without using the "Import Tool"
Use as Mock API
Using Addons
Use Base64 Addon
Use Hashing Addon (MD5, SHA1, SHA256, SHA512)
Use UUID-v4 Addon
Deflate/Inflate and GZip/UnGZip
Deflate/inflate
GZip/UnGZip
JWT Decode
Logging
Regex
Only number
Regex to get the Scheme, Host, Port, Path, and Query of the URL
Miscellaneous
By-pass CORS
Inject Header to Request / Response
Response delay with sleep() function
AES Encryption/Decryption
DES Encryption/Decryption
Write / Export to a local file
Check if the first exist
Read a file
Map Remotes
Map v1 to v2 endpoints
Map localhost to production
Map production to localhost
Make async/await HTTP Request (macOS)
GET Request with Query
POST Request with JSON Body
POST Request with application/x-www-form-urlencoded body
PUT / PATCH / DELETE Request
Make async/await HTTP Request (Windows/Linux)
Abort the request/response like Block List Tool
Abort the request
Abort the response
URL and URLSearchParams
Reload System Environment Variables
Change Websocket URL, Requests/Response Header
Last updated