Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: response

[8:14] (extern: com.lehman.aussom.AResponse) extends: object

The response class wraps a network response received by a page. Instances are obtained via page.navigate(), page.waitForResponse(), or from a request object via request.response().

Methods

  • url ()

    Returns the URL of the response.

    • @r A string URL.
  • status ()

    Returns the HTTP status code of the response (e.g. 200, 404).

    • @r An int HTTP status code.
  • statusText ()

    Returns the HTTP status text of the response (e.g. 'OK', 'Not Found').

    • @r A string status text.
  • headers ()

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

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

    Returns whether the response was successful (status in range 200-299).

    • @r A bool - true if the response status is in the 2xx range.
  • text ()

    Returns the response body as a string decoded as UTF-8.

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

    Returns the request that triggered this response.

    • @r A request object.