Package-level declarations

Types

Link copied to clipboard
class CompletingByteReadChannel(deferred: <Error class: unknown class><String>, hashingChannel: <Error class: unknown class>)

An SdkByteReadChannel which uses the underlying hashingChannel's checksum to complete a CompletableDeferred value.

Link copied to clipboard
class CompletingSource(deferred: <Error class: unknown class><String>, hashingSource: <Error class: unknown class>)

An SdkSource which uses the underlying hashingSource's checksum to complete a CompletableDeferred value.

Link copied to clipboard
interface DeferredHeaders

Immutable mapping of case insensitive HTTP header names to list of Deferred values.

Link copied to clipboard

Build an immutable HTTP deferred header map

Link copied to clipboard
interface Headers

Immutable mapping of case insensitive HTTP header names to list of String values.

Link copied to clipboard

Build an immutable HTTP header map

Link copied to clipboard
sealed class HttpBody

HTTP payload to be sent to a peer

Link copied to clipboard
open class HttpCall(val request: HttpRequest, val response: HttpResponse, val requestTime: <Error class: unknown class> = Instant.now(), val responseTime: <Error class: unknown class> = Instant.now(), val coroutineContext: <Error class: unknown class> = EmptyCoroutineContext)

A single request/response pair

Link copied to clipboard
Link copied to clipboard

Base exception class for HTTP errors

Link copied to clipboard

Represents an HTTP verb

Link copied to clipboard
data class HttpStatusCode(val value: Int, val description: String)

Container for an HTTP status code

Inherited properties

Inherited functions

Link copied to clipboard
Link copied to clipboard
suspend fun HttpCall.complete()

Close the underlying response and cleanup any resources associated with it. After closing the response body is no longer valid and should not be read from.

Link copied to clipboard

Check if the given status code is an informational code (HTTP codes 100 to 199 are considered informational)

Link copied to clipboard

Check if the given status code is a success code (HTTP codes 200 to 299 are considered successful)

Link copied to clipboard
suspend fun HttpBody.readAll(): ByteArray?

Consume the HttpBody and pull the entire contents into memory as a ByteArray. Only do this if you are sure the contents fit in-memory as this will read the entire contents of a streaming variant.

Link copied to clipboard
fun HttpBody.toByteStream(): <Error class: unknown class>?

Convert an HttpBody variant to the corresponding ByteStream variant or null if empty.

Link copied to clipboard
fun HttpBody.toCompletingBody(deferred: <Error class: unknown class><String>): HttpBody

Convert an HttpBody with an underlying HashingSource or HashingByteReadChannel to a CompletingSource or CompletingByteReadChannel, respectively.

Link copied to clipboard
fun HttpBody.toHashingBody(hashFunction: <Error class: unknown class>, contentLength: Long?): HttpBody

Convert an HttpBody.SourceContent or HttpBody.ChannelContent to a body with a HashingSource or HashingByteReadChannel, respectively.

Link copied to clipboard

Convert a DeferredHeaders instance to Headers. This will block while awaiting all Deferred header values.

Link copied to clipboard
fun <Error class: unknown class>.toHttpBody(): HttpBody

Convert a ByteStream to the equivalent HttpBody variant

Convert a ByteArray into an HttpBody

Convert a String into an HttpBody

fun <Error class: unknown class>.toHttpBody(contentLength: Long? = null): HttpBody

Convert a SdkByteReadChannel to an HttpBody

fun <Error class: unknown class>.toHttpBody(contentLength: Long? = null): HttpBody

Convert an SdkSource to an HttpBody

Link copied to clipboard
fun HttpBody.toSdkByteReadChannel(scope: <Error class: unknown class>? = null): <Error class: unknown class>?

Convenience function to treat all HttpBody variants with a payload as an SdkByteReadChannel