Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CacheResponse

public abstract class CacheResponse
extends Object

java.lang.Object
   ↳ java.net.CacheResponse
Known Direct Subclasses


A response cache entry. A CacheResponse object provides an InputStream to access the response body and a Map for the response headers.

See also:

Summary

Public constructors

CacheResponse()

Public methods

abstract InputStream getBody()

Returns an InputStream to access the response body.

abstract Map<StringList<String>> getHeaders()

Returns an immutable Map which contains the response headers information.

Inherited methods

From class java.lang.Object

Public constructors

CacheResponse

Added in API level 1
CacheResponse ()

Public methods

getBody

Added in API level 1
InputStream getBody ()

Returns an InputStream to access the response body.

Returns
InputStream an InputStream which can be used to fetch the response body.
Throws
IOException if an I/O error is encountered while retrieving the response body.

getHeaders

Added in API level 1
Map<StringList<String>> getHeaders ()

Returns an immutable Map which contains the response headers information. Note that URLConnection may need the original headers to be able to fully reconstruct the response. In particular, failure to provide a mapping from null to the original HTTP status line will prevent an HttpURLConnection from returning the correct response code. See getHeaderFields().

Returns
Map<StringList<String>> an immutable Map which contains the response headers.
Throws
IOException if an I/O error is encountered while retrieving the response headers.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.