HttpClientCall

open class HttpClientCall(client: HttpClient) : CoroutineScope

A class that represents a single pair of request and response for a specific HttpClient.

Constructors

Link copied to clipboard
fun HttpClientCall(client: HttpClient, requestData: HttpRequestData, responseData: HttpResponseData)
Link copied to clipboard
fun HttpClientCall(client: HttpClient)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun body(info: TypeInfo): Any

Tries to receive the payload of the response as a specific expected type provided in info. Returns response if info corresponds to HttpResponse.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val attributes: Attributes

Typed Attributes associated to this call serving as a lightweight container.

Link copied to clipboard
val client: HttpClient

: client that executed the call.

Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
lateinit var request: HttpRequest

Represents the request sent by the client

Link copied to clipboard
lateinit var response: HttpResponse

Represents the response sent by the server.

Extensions

Link copied to clipboard
inline suspend fun <T> HttpClientCall.body(): T

Tries to receive the payload of the response as a specific type T.

Link copied to clipboard
inline suspend fun <T> HttpClientCall.receive(): T

Tries to receive the payload of the response as a specific type T.

suspend fun HttpClientCall.receive(info: TypeInfo): Any

Tries to receive the payload of the response as a specific expected type provided in info. Returns response if info corresponds to HttpResponse.

Link copied to clipboard
suspend fun HttpClientCall.save(): HttpClientCall

Fetch data for HttpClientCall and close the origin.

Link copied to clipboard
fun HttpClientCall.wrapWithContent(content: ByteReadChannel, shouldCloseOrigin: Boolean): HttpClientCall
fun HttpClientCall.wrapWithContent(content: ByteReadChannel): HttpClientCall

Wrap existing HttpClientCall with new content.