HttpClientCall
open class HttpClientCall : CoroutineScope, Closeable
A class that represents a single pair of request and response for a specific HttpClient.
Properties
val attributes: Attributes Typed Attributes associated to this call serving as a lightweight container. |
|
val client: HttpClient : client that executed the call. |
|
open val coroutineContext: <ERROR CLASS> |
|
lateinit var request: HttpRequest Represents the request sent by the client |
|
lateinit var response: HttpResponse Represents the response sent by the server. |
|
val Configuration for the response. |
Functions
open fun close(): Unit Closes the underlying response. |
|
Tries to receive the payload of the response as an specific expectedType. Returns response if expectedType is HttpResponse. |
Companion Object Properties
val CustomResponse: AttributeKey<Any> CustomResponse key used to process the response of custom type in case of HttpClientEngine can’t return body bytes directly. If present, attribute value will be an initial value for HttpResponseContainer in HttpClient.responsePipeline. |
Extension Functions
fun CoroutineScope.decodeChunked( Start a chunked stream decoder coroutine |
|
fun <TEngine : ApplicationEngine, TConfiguration : Configuration> CoroutineScope.embeddedServer( Creates an embedded server with the given factory, listening on host:port |
|
fun CoroutineScope.httpServer( Start an http server with settings invoking handler for every request |
|
fun CoroutineScope.parseMultipart( fun CoroutineScope.parseMultipart( fun CoroutineScope.parseMultipart( Starts a multipart parser coroutine producing multipart events |
|
fun CoroutineScope.pinger( Launch pinger coroutine on CoroutineScope that is sending ping every specified period to outgoing channel, waiting for and verifying client’s pong frames. It is also handling timeout and sending timeout close frame fun CoroutineScope.pinger( Launch pinger coroutine on CoroutineScope that is sending ping every specified periodMillis to outgoing channel, waiting for and verifying client’s pong frames. It is also handling timeoutMillis and sending timeout close frame |
|
fun CoroutineScope.ponger( Launch a ponger actor job on the CoroutineScope sending pongs to outgoing channel. It is acting for every client’s ping frame and replying with corresponding pong |
|
suspend fun <T> HttpClientCall.receive(): T Tries to receive the payload of the response as an specific type T. |
|
suspend fun HttpClientCall.save(): HttpClientCall Fetch data for HttpClientCall and close the origin. |
|
fun CoroutineScope.startConnectionPipeline( Start connection HTTP pipeline invoking handler for every request. Note that handler could be invoked multiple times concurrently due to HTTP pipeline nature |
|
fun HttpClientCall. fun HttpClientCall.wrapWithContent( Wrap existing HttpClientCall with new content. |
|
fun CoroutineScope.writeMultipleRanges( Start multirange response writer coroutine |