Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions) Summary: [Ctors](https://developer.android.com/reference/android/net/http/UrlResponseInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/net/http/UrlResponseInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/http/UrlResponseInfo#inhmethods)

# UrlResponseInfo

*** ** * ** ***


`
public


abstract
class
UrlResponseInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.http.UrlResponseInfo |

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#UrlResponseInfo()() ` |

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/android/net/http/HeaderBlock` | ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#getHeaders()() ` Returns the response headers. |
| ` abstract int` | ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#getHttpStatusCode()() ` Returns the HTTP status code. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#getHttpStatusText()() ` Returns the HTTP status text of the status line. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#getNegotiatedProtocol()() ` Returns the protocol (for example 'quic/1+spdy/3') negotiated with the server. |
| ` abstract long` | ` https://developer.android.com/reference/android/net/http/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` | ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#getUrl()() ` Returns the URL the response is for. |
| ` abstract https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/net/http/UrlResponseInfo#getUrlChain()() ` Returns the URL chain. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/net/http/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. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### UrlResponseInfo

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public UrlResponseInfo ()
```

<br />

<br />

## Public methods

### getHeaders

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
public abstract HeaderBlock getHeaders ()
```

Returns the response headers.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/http/HeaderBlock` | This value cannot be `null`. <br /> |

### getHttpStatusCode

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
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.

<br />

| Returns ||
|---|---|
| `int` | the HTTP status code. <br /> |

### getHttpStatusText

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
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".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the HTTP status text of the status line. This value cannot be `null`. <br /> |

### getNegotiatedProtocol

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the protocol negotiated with the server. This value cannot be `null`. <br /> |

### getReceivedByteCount

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
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/reference/android/net/http/UrlResponseInfo` instance) as the request
progresses until completion, when `https://developer.android.com/reference/android/net/http/UrlRequest.Callback#onSucceeded(android.net.http.UrlRequest,%20android.net.http.UrlResponseInfo)`,
`https://developer.android.com/reference/android/net/http/UrlRequest.Callback#onFailed(android.net.http.UrlRequest,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)`, or `https://developer.android.com/reference/android/net/http/UrlRequest.Callback#onCanceled(android.net.http.UrlRequest,%20android.net.http.UrlResponseInfo)` is called.

<br />

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

### getUrl

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the URL the response is for. This value cannot be `null`. <br /> |

### getUrlChain

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

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

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | the URL chain. This value cannot be `null`. <br /> |

### wasCached

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [S Extensions 7](https://developer.android.com/sdkExtensions)

```
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.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the response came from the cache, `false` otherwise. <br /> |