Skip to main content

request

Returns request information made by the Browser with optional filters via arguments. You may filter the returned results by a lob-like URL-pattern, the method of the request or the type of request. Applying an operator to this will then change the behavior by either "and"ing the filters together or "or"ing them. This API will automatically wait for the request to be made if none is immediately found which you can turn off by disabling the "wait" option.

Getting all "Document" requests

  mutation DocumentRequests {
goto(url: "https://example.com/", waitUntil: load) {
status
}
request(type:document) {
url
type
method
headers {
name
value
}
}
}

Load all "GET" AJAX Requests

  mutation AJAXGetCalls {
goto(url: "https://msn.com/", waitUntil: load) {
status
}
request(type: xhr, method: GET, operator: and) {
url
type
method
headers {
name
value
}
}
}
request(
type: [ResourceType]
method: [Method]
timeout: Float
url: [String]
wait: Boolean = true
operator: OperatorTypes = or
): [RequestResponse]

Arguments

request.type ● [ResourceType] list enum

The type content-type of the request to match against

request.method ● [Method] list enum

The method of the request to return results for

request.timeout ● Float scalar

How long to wait for the request(s) to be made before timing out, overriding any defaults. Default timeout is 30 seconds, or 30000. "wait" parameter must also be "true".

request.url ● [String] list scalar

The pattern of the request URL to wait for, using glob-style pattern-matching

request.wait ● Boolean scalar

Whether or not to wait for the request to be made. When set to true, generally only one request is returned since this API will wait for the first request that matches any patterns to be returned

request.operator ● OperatorTypes enum

When applying arguments like URL or method, this operator will either "and" them together, or "or" them together. Default is "or"

Type

RequestResponse object

Response returned from the request API