Class XMLHttpRequest.NetworkErrorWebResponse

java.lang.Object
org.htmlunit.WebResponse
org.htmlunit.javascript.host.xml.XMLHttpRequest.NetworkErrorWebResponse
All Implemented Interfaces:
Serializable
Enclosing class:
XMLHttpRequest

private static final class XMLHttpRequest.NetworkErrorWebResponse extends WebResponse
  • Field Details

  • Constructor Details

  • Method Details

    • getStatusCode

      public int getStatusCode()
      Description copied from class: WebResponse
      Returns the status code that was returned by the server.
      Overrides:
      getStatusCode in class WebResponse
      Returns:
      the status code that was returned by the server
    • getStatusMessage

      public String getStatusMessage()
      Description copied from class: WebResponse
      Returns the status message that was returned from the server.
      Overrides:
      getStatusMessage in class WebResponse
      Returns:
      the status message that was returned from the server
    • getContentType

      public String getContentType()
      Description copied from class: WebResponse
      Returns the content type returned from the server, e.g. "text/html".
      Overrides:
      getContentType in class WebResponse
      Returns:
      the content type returned from the server, e.g. "text/html"
    • getContentAsString

      public String getContentAsString()
      Description copied from class: WebResponse
      Returns the response content as a string, using the charset/encoding specified in the server response.
      Overrides:
      getContentAsString in class WebResponse
      Returns:
      the response content as a string, using the charset/encoding specified in the server response or null if the content retrieval was failing
    • getContentAsStream

      public InputStream getContentAsStream()
      Description copied from class: WebResponse
      Returns the response content as an input stream.
      Overrides:
      getContentAsStream in class WebResponse
      Returns:
      the response content as an input stream
    • getResponseHeaders

      public List<NameValuePair> getResponseHeaders()
      Description copied from class: WebResponse
      Returns the response headers as a list of NameValuePairs.
      Overrides:
      getResponseHeaders in class WebResponse
      Returns:
      the response headers as a list of NameValuePairs
    • getResponseHeaderValue

      public String getResponseHeaderValue(String headerName)
      Description copied from class: WebResponse
      Returns the value of the specified response header.
      Overrides:
      getResponseHeaderValue in class WebResponse
      Parameters:
      headerName - the name of the header whose value is to be returned
      Returns:
      the header value, null if no response header exists with this name
    • getLoadTime

      public long getLoadTime()
      Description copied from class: WebResponse
      Returns the time it took to load this web response, in milliseconds.
      Overrides:
      getLoadTime in class WebResponse
      Returns:
      the time it took to load this web response, in milliseconds
    • getContentCharset

      public Charset getContentCharset()
      Description copied from class: WebResponse
      Returns the content charset for this response, even if no charset was specified explicitly.

      This method always returns a valid charset. This method first checks the Content-Type header or in the content BOM for viable charset. If not found, it attempts to determine the charset based on the type of the content. As a last resort, this method returns the value of WebRequest.getDefaultResponseContentCharset() which is StandardCharsets.UTF_8 by default.

      Overrides:
      getContentCharset in class WebResponse
      Returns:
      the content charset for this response
    • getContentCharsetOrNull

      public Charset getContentCharsetOrNull()
      Description copied from class: WebResponse
      Returns the content charset specified explicitly in the header or in the content, or null if none was specified.
      Overrides:
      getContentCharsetOrNull in class WebResponse
      Returns:
      the content charset specified explicitly in the header or in the content, or null if none was specified
    • getWebRequest

      public WebRequest getWebRequest()
      Description copied from class: WebResponse
      Returns the request used to load this response.
      Overrides:
      getWebRequest in class WebResponse
      Returns:
      the request used to load this response
    • getError

      public IOException getError()
      Returns:
      the error