Package-level declarations

Types

Link copied to clipboard
@InternalCoilApi
object CacheNetworkResponse

Utility methods used to read/write a NetworkResponse from/to the disk cache.

Link copied to clipboard
@ExperimentalCoilApi
interface CacheStrategy

Controls the behavior around reading/writing responses from/to the disk cache.

Link copied to clipboard
@ExperimentalCoilApi
fun interface ConnectivityChecker

Determines if the device is able to access the internet.

Link copied to clipboard

Exception for an unexpected, non-2xx HTTP response.

Link copied to clipboard
interface NetworkClient

An asynchronous HTTP client that executes NetworkRequests and returns NetworkResponses.

Link copied to clipboard
class NetworkFetcher(url: String, options: Options, networkClient: Lazy<NetworkClient>, diskCache: Lazy<DiskCache?>, cacheStrategy: Lazy<CacheStrategy>, connectivityChecker: ConnectivityChecker) : Fetcher

A Fetcher that fetches and caches images from the network.

Link copied to clipboard
@Poko
class NetworkHeaders

A list of HTTP headers.

Link copied to clipboard
@Poko
class NetworkRequest(val url: String, val method: String = HTTP_METHOD_GET, val headers: NetworkHeaders = NetworkHeaders.EMPTY, val body: NetworkRequestBody? = null, val extras: Extras = Extras.EMPTY)

Represents an HTTP request.

Link copied to clipboard
Link copied to clipboard
@Poko
class NetworkResponse(val code: Int = HTTP_RESPONSE_OK, val requestMillis: Long = 0, val responseMillis: Long = 0, val headers: NetworkHeaders = NetworkHeaders.EMPTY, val body: NetworkResponseBody? = null, val delegate: Any? = null)

Represents an HTTP response.

Link copied to clipboard

Properties

Link copied to clipboard
val Extras.Key.Companion.httpBody: Extras.Key<NetworkRequestBody?>
val ImageRequest.httpBody: NetworkRequestBody?
Link copied to clipboard
val Extras.Key.Companion.httpHeaders: Extras.Key<NetworkHeaders>
val ImageRequest.httpHeaders: NetworkHeaders
Link copied to clipboard
val Extras.Key.Companion.httpMethod: Extras.Key<String>
val ImageRequest.httpMethod: String
val Options.httpMethod: String

Functions

Link copied to clipboard
@ExperimentalCoilApi
expect fun ConnectivityChecker(context: PlatformContext): ConnectivityChecker
actual fun ConnectivityChecker(context: PlatformContext): ConnectivityChecker
Link copied to clipboard
fun ImageRequest.Builder.httpBody(body: NetworkRequestBody): ImageRequest.Builder

Set the HTTP request body for any network operations performed by this image request.

Link copied to clipboard
fun ImageRequest.Builder.httpHeaders(headers: NetworkHeaders): ImageRequest.Builder

Set the HTTP request headers for any network operations performed by this image request.

Link copied to clipboard
fun ImageRequest.Builder.httpMethod(method: String): ImageRequest.Builder

Set the HTTP request method for any network operations performed by this image request.

Link copied to clipboard
fun NetworkRequestBody(bytes: ByteString): NetworkRequestBody
Link copied to clipboard
fun NetworkResponseBody(source: BufferedSource): NetworkResponseBody