HTTP Response Manipulation APIs

abstract These APIs help manipulate HTTP response of browsers or devices.

Add Response Substitution Rule

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.

Parameters
$namestring Response substitution rule name
$urlPatternstring Substitution url pattern
$isRegExpboolean Boolean parameter to find the string as regular expressions if true.
$findstring Find the value to replace.
$replacestring Replacing all occurrences of old value in this string.
Return Value

Modes Supported :
Raw Script
//Add the response substitution rule.
_addResponseSubstitutionRule("test", "http://sahitest.com/demo/", false, "Link Test", "Link Test1");

Sahi Pro Classic API :_addResponseSubstitutionRule

Remove Response Substitution Rule

Removes the response substitution rule for all further responces coming in this browser session.

Parameters
$namestring Response substitution rule name
Return Value

Modes Supported :
Raw Script
//Remove the response substitution rule.
_removeResponseSubstitutionRule("test");

Sahi Pro Classic API :_removeResponseSubstitutionRule