replace-xhr-request

Check that the replace-xhr-request snippet is working as expected.

Basic

Test that a string in the XHR request body is replaced with the given replacement value.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters

Regex

Test that a regex pattern in the XHR request body is replaced with the given replacement value.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters

Needle

Test that replacement only happens when the needle matches the request body.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters

JSONPath

Test that a JSONPath expression targets and replaces a nested property in the request body.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters

JSONPath append

Test that JSONPath append mode pushes a value into an existing array in the request body.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters

JSONPath remove

Test that JSONPath remove mode deletes every matched element from an array in the request body, leaving the other elements in place.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters

URL token

Test that a url: token in the needle matches the request URL: the request goes to a URL containing url-token, and its body is rewritten.

Example Content
Waiting 500ms to trigger snippet...
XHR request body was replaced

Steps

Filters