# UrlResponseInfo


```
public abstract class UrlResponseInfo
```

<br />

*** ** * ** ***

Basic information about a response. Included in `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback` callbacks. Each `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback#onRedirectReceived(org.chromium.net.UrlRequest,org.chromium.net.UrlResponseInfo,java.lang.String)` callback gets a different copy of `UrlResponseInfo` describing a particular redirect response.

## Summary

| ### Nested types |
|---|
| `public abstract class https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.HeaderBlock` Unmodifiable container of response headers or trailers. |

| ### Public constructors |
|---|
| `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#UrlResponseInfo()()` |

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>>` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getAllHeaders()()` Returns an unmodifiable map of the response-header fields and values. |
| `abstract https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/Map.Entry.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>>` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getAllHeadersAsList()()` Returns an unmodifiable list of response header field and value pairs. |
| `abstract int` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getHttpStatusCode()()` Returns the HTTP status code. |
| `abstract https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getHttpStatusText()()` Returns the HTTP status text of the status line. |
| `abstract https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getNegotiatedProtocol()()` Returns the protocol (for example 'quic/1+spdy/3') negotiated with the server. |
| `abstract https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getProxyServer()()` Returns the proxy server that was used for the request. |
| `abstract long` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getReceivedByteCount()()` Returns a minimum count of bytes received from the network to process this request. |
| `abstract https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getUrl()()` Returns the URL the response is for. |
| `abstract https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#getUrlChain()()` Returns the URL chain. |
| `abstract boolean` | `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo#wasCached()()` Returns `true` if the response came from the cache, including requests that were revalidated over the network before being retrieved from the cache. |

## Public constructors

### UrlResponseInfo

```
public UrlResponseInfo()
```

## Public methods

### getAllHeaders

```
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 |
|---|---|
| `https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>>` | an unmodifiable map of the response-header fields and values. |

### getAllHeadersAsList

```
public abstract List<Map.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 |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/util/Map.Entry.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>>` | an unmodifiable list of response header field and value pairs. |

### getHttpStatusCode

```
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 |
|---|---|
| `int` | the HTTP status code. |

### getHttpStatusText

```
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 |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | the HTTP status text of the status line. |

### getNegotiatedProtocol

```
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 |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | the protocol negotiated with the server. |

### getProxyServer

```
public abstract String getProxyServer()
```

Returns the proxy server that was used for the request.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | the proxy server that was used for the request. |

### getReceivedByteCount

```
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 includes headers and data from all redirects. This value may change (even for one `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo` instance) as the request progresses until completion, when `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback#onSucceeded(org.chromium.net.UrlRequest,org.chromium.net.UrlResponseInfo)`, `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback#onFailed(org.chromium.net.UrlRequest,org.chromium.net.UrlResponseInfo,org.chromium.net.CronetException)`, or `https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback#onCanceled(org.chromium.net.UrlRequest,org.chromium.net.UrlResponseInfo)` is called.

| Returns |
|---|---|
| `long` | a minimum count of bytes received from the network to process this request. |

### getUrl

```
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 |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | the URL the response is for. |

### getUrlChain

```
public abstract List<String> getUrlChain()
```

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

| Returns |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | the URL chain. |

### wasCached

```
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 |
|---|---|
| `boolean` | `true` if the response came from the cache, `false` otherwise. |