Getting Started
API Client
Inspect Traffic
HTTP Rules (Modify Traffic)
Redirect URL (Map Local, Map Remote)
Replace Strings (Switch Hosts, API Endpoints)
The Modify Response Rule allows you to mock the response body of an HTTP request.
Response Rule resource types
In this mode, you can enter the response body which you want as the response.
Response Rule - Static Body
URL
, Host
or Path
with Regex
, Contains
, Wildcard
or Equals
to match the source request. Learn more about source conditions here.Programmatic Modification Script (JS) : Write a JavaScript script which can modify the existing response programmatically.
modifyResponse
method
(string)- The HTTP method of the request. GET | POST | PUT | DELETE
etc.url
(string) - The request URL.response
(string)- The original response object represented as string. Eg:'{"id":1,"app":"requestly","feature":"modify-request"}'
responseType
(string)- The content-type of the HTTP response.requestHeaders
(Object<string, string>)- The request headers sent to the server.requestData
(string)- The HTTP request payload in case of POST | PUT | PATCH
requests.responseJSON
(JSON object)- The original response represented as JSON Object:{
"id":1,
"app":"requestly",
"feature":"modify-request"
}
string
or JSON
object)You can modify both response or responseJSON and return any of them. Response Rule will automatically handle the response returned for the request.
You can target GraphQL requests using the operation name in request body. To do so add:
operationName
getUsers
To learn more about this checkout GraphQL Support.
console.log
show up?