HTTP Response Manipulation APIs
abstract
These APIs help manipulate HTTP response of browsers or devices.
_addResponseSubstitutionRule
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
8.0.0 | NA | NA | NA | NA |
Available for modes: Browser
_addResponseSubstitutionRule($name, $urlPattern, $isRegExp, $find, $replace)
Arguments
$name | string | Response substitution rule name |
$urlPattern | string | Substitution url pattern |
$isRegExp | boolean | Boolean parameter to find the string as regular expressions if true. |
$find | string | Find the value to replace. |
$replace | string | Replacing all occurrences of old value in this string. |
Returns
null |
Sahi Pro Flowcharts Action :Add Response Substitution Rule
Details
Substitutes the HTTP response for all further responces coming in this browser session. If a HTTP Response Substitution Rule of given name already exists, it will be replaced.
Substitutes the HTTP response for all further responces coming in this browser session. If a HTTP Response Substitution Rule of given name already exists, it will be replaced.
//Add the response substitution rule.
_addResponseSubstitutionRule("test", "http://sahitest.com/demo/", false, "Link Test", "Link Test1");
_removeResponseSubstitutionRule
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
8.0.0 | NA | NA | NA | NA |
Available for modes: Browser
_removeResponseSubstitutionRule($name)
Arguments
$name | string | Response substitution rule name |
Returns
null |
Sahi Pro Flowcharts Action :Remove Response Substitution Rule
Details
Removes the response substitution rule for all further responces coming in this browser session.
Removes the response substitution rule for all further responces coming in this browser session.
//Remove the response substitution rule.
_removeResponseSubstitutionRule("test");