← Back to Network domain

Network.searchInResponseBody

Searches for given string in response content.

Domain: Network experimental

Parameters

NameTypeDescription
requestIdRequestIdIdentifier of the network response to search.
querystringString to search for.
caseSensitive (optional)booleanIf true, search is case sensitive.
isRegex (optional)booleanIf true, treats string parameter as regex.

Returns

NameTypeDescription
resultarrayList of search matches.

Example Request

{
  "id": 1,
  "method": "Network.searchInResponseBody",
  "params": {
    "requestId": "request-1",
    "query": "query-value"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "result": {
      "type": "string",
      "value": "Example Domain"
    }
  }
}

Usage in Node.js

const result = await send('Network.searchInResponseBody', {"requestId": "request-1", "query": "query-value"});
console.log(result);
// {"result": {"type": "string", "value": "Example Domain"}}