Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: request

[7:14] (extern: com.lehman.aussom.ARequest) extends: object

The request class wraps a network request made by a page. Instances are obtained via page.waitForRequest() or network event handlers.

Methods

  • url ()

    Returns the URL of the network request.

    • @r A string URL.
  • method ()

    Returns the HTTP method of the request (e.g. 'GET', 'POST').

    • @r A string HTTP method.
  • headers ()

    Returns the request headers as a map of header name to value strings.

    • @r A map of string header names to string values.
  • postData ()

    Returns the request body (POST data) as a string, or an empty string if the request has no body.

    • @r A string request body.
  • resourceType ()

    Returns the resource type of the request such as 'document', 'stylesheet', 'image', 'script', 'font', 'xhr', 'fetch', or 'websocket'.

    • @r A string resource type.
  • isNavigationRequest ()

    Returns whether this is a navigation request (i.e. a request for a document that results in page navigation).

    • @r A bool - true if this is a navigation request.
  • response ()

    Returns the response that was received for this request, or null if the request has not yet completed or failed.

    • @r A response object or null.