Class ResponseImpl

All Implemented Interfaces:
Response

public class ResponseImpl extends ChannelOwner implements Response
  • Field Details

  • Constructor Details

  • Method Details

    • allHeaders

      public Map<String,String> allHeaders()
      Description copied from interface: Response
      An object with all the response HTTP headers associated with this response.
      Specified by:
      allHeaders in interface Response
    • body

      public byte[] body()
      Description copied from interface: Response
      Returns the buffer with response body.
      Specified by:
      body in interface Response
    • finished

      public String finished()
      Description copied from interface: Response
      Waits for this response to finish, returns always null.
      Specified by:
      finished in interface Response
    • frame

      public Frame frame()
      Description copied from interface: Response
      Returns the Frame that initiated this response.
      Specified by:
      frame in interface Response
    • fromServiceWorker

      public boolean fromServiceWorker()
      Description copied from interface: Response
      Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via FetchEvent.respondWith).
      Specified by:
      fromServiceWorker in interface Response
    • headers

      public Map<String,String> headers()
      Description copied from interface: Response
      An object with the response HTTP headers. The header names are lower-cased. Note that this method does not return security-related headers, including cookie-related ones. You can use Response.allHeaders() for complete list of headers that include cookie information.
      Specified by:
      headers in interface Response
    • headersArray

      public List<HttpHeader> headersArray()
      Description copied from interface: Response
      An array with all the request HTTP headers associated with this response. Unlike Response.allHeaders(), header names are NOT lower-cased. Headers with multiple entries, such as Set-Cookie, appear in the array multiple times.
      Specified by:
      headersArray in interface Response
    • headerValue

      public String headerValue(String name)
      Description copied from interface: Response
      Returns the value of the header matching the name. The name is case insensitive. If multiple headers have the same name (except set-cookie), they are returned as a list separated by , . For set-cookie, the \n separator is used. If no headers are found, null is returned.
      Specified by:
      headerValue in interface Response
      Parameters:
      name - Name of the header.
    • headerValues

      public List<String> headerValues(String name)
      Description copied from interface: Response
      Returns all values of the headers matching the name, for example set-cookie. The name is case insensitive.
      Specified by:
      headerValues in interface Response
      Parameters:
      name - Name of the header.
    • ok

      public boolean ok()
      Description copied from interface: Response
      Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
      Specified by:
      ok in interface Response
    • request

      public RequestImpl request()
      Description copied from interface: Response
      Returns the matching Request object.
      Specified by:
      request in interface Response
    • securityDetails

      public SecurityDetails securityDetails()
      Description copied from interface: Response
      Returns SSL and other security information.
      Specified by:
      securityDetails in interface Response
    • serverAddr

      public ServerAddr serverAddr()
      Description copied from interface: Response
      Returns the IP address and port of the server.
      Specified by:
      serverAddr in interface Response
    • status

      public int status()
      Description copied from interface: Response
      Contains the status code of the response (e.g., 200 for a success).
      Specified by:
      status in interface Response
    • statusText

      public String statusText()
      Description copied from interface: Response
      Contains the status text of the response (e.g. usually an "OK" for a success).
      Specified by:
      statusText in interface Response
    • text

      public String text()
      Description copied from interface: Response
      Returns the text representation of response body.
      Specified by:
      text in interface Response
    • url

      public String url()
      Description copied from interface: Response
      Contains the URL of the response.
      Specified by:
      url in interface Response
    • getRawHeaders

      private RawHeaders getRawHeaders()