public abstract class

UrlResponseInfo

extends Object
java.lang.Object
   ↳ com.tencent.smtt.export.external.interfaces.UrlResponseInfo

Class Overview

Basic information about a response. Included in UrlRequest.Callback callbacks. Each onRedirectReceived() callback gets a different copy of UrlResponseInfo describing a particular redirect response.

Summary

Nested Classes
class UrlResponseInfo.HeaderBlock Unmodifiable container of response headers or trailers. 
Public Constructors
UrlResponseInfo()
Public Methods
abstract Map<String, List<String>> getAllHeaders()
Returns an unmodifiable map of the response-header fields and values.
abstract List<Entry<String, String>> getAllHeadersAsList()
Returns an unmodifiable list of response header field and value pairs.
abstract int getHttpStatusCode()
Returns the HTTP status code.
abstract String getHttpStatusText()
Returns the HTTP status text of the status line.
abstract String getNegotiatedProtocol()
Returns the protocol (for example 'quic/1+spdy/3') negotiated with the server.
abstract String getProxyServer()
Returns the proxy server that was used for the request.
abstract long getReceivedByteCount()
Returns a minimum count of bytes received from the network to process this request.
Map<String, List<String>> getRequestHeaders()
Gets the headers associated with the request.
String getServerIP()
Get Server ip address
abstract String getUrl()
Returns the URL the response is for.
abstract List<String> getUrlChain()
Returns the URL chain.
abstract boolean wasCached()
Returns true if the response came from the cache, including requests that were revalidated over the network before being retrieved from the cache.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public UrlResponseInfo ()

Public Methods

public abstract Map<String, List<String>> getAllHeaders ()

Returns an unmodifiable map of the response-header fields and values. Each list of values for a single header field is in the same order they were received over the wire.

Returns
  • an unmodifiable map of the response-header fields and values.

public abstract List<Entry<String, String>> getAllHeadersAsList ()

Returns an unmodifiable list of response header field and value pairs. The headers are in the same order they are received over the wire.

Returns
  • an unmodifiable list of response header field and value pairs.

public abstract int getHttpStatusCode ()

Returns the HTTP status code. When a resource is retrieved from the cache, whether it was revalidated or not, the original status code is returned.

Returns
  • the HTTP status code.

public abstract String getHttpStatusText ()

Returns the HTTP status text of the status line. For example, if the request received a "HTTP/1.1 200 OK" response, this method returns "OK".

Returns
  • the HTTP status text of the status line.

public abstract String getNegotiatedProtocol ()

Returns the protocol (for example 'quic/1+spdy/3') negotiated with the server. Returns an empty string if no protocol was negotiated, the protocol is not known, or when using plain HTTP or HTTPS.

Returns
  • the protocol negotiated with the server.

public abstract String getProxyServer ()

Returns the proxy server that was used for the request.

Returns
  • the proxy server that was used for the request.

public abstract long getReceivedByteCount ()

Returns a minimum count of bytes received from the network to process this request. This count may ignore certain overheads (for example IP and TCP/UDP framing, SSL handshake and framing, proxy handling). This count is taken prior to decompression (for example GZIP and SDCH) and includes headers and data from all redirects. This value may change (even for one UrlResponseInfo instance) as the request progresses until completion, when onSucceeded(), onFailed(), or onCanceled() is called.

Returns
  • a minimum count of bytes received from the network to process this request.

public Map<String, List<String>> getRequestHeaders ()

Gets the headers associated with the request. These are represented as a mapping of header name to header value.

Returns
  • the headers associated with the request.

public String getServerIP ()

Get Server ip address

Returns
  • ip address

public abstract String getUrl ()

Returns the URL the response is for. This is the URL after following redirects, so it may not be the originally requested URL.

Returns
  • the URL the response is for.

public abstract List<String> getUrlChain ()

Returns the URL chain. The first entry is the originally requested URL; the following entries are redirects followed.

Returns
  • the URL chain.

public abstract boolean wasCached ()

Returns true if the response came from the cache, including requests that were revalidated over the network before being retrieved from the cache.

Returns
  • true if the response came from the cache, false otherwise.