ClientPluginBuilder

An utility class used to build a ClientPlugin instance.

Properties

Link copied to clipboard

A reference to the HttpClient where the plugin is installed.

Link copied to clipboard

A configuration of the current plugin.

Functions

Link copied to clipboard

Specifies a handler for a specific hook. A hook can be a specific place in time or event during the request processing like receiving a response, an exception during call processing, etc.

Link copied to clipboard
fun onClose(block: () -> Unit)

Specifies the block to clean resources allocated with this plugin.

Link copied to clipboard
fun onRequest(block: suspend OnRequestContext.(request: HttpRequestBuilder, content: Any) -> Unit)

Specifies the block handler for every HTTP request.

Link copied to clipboard
fun onResponse(block: suspend OnResponseContext.(response: HttpResponse) -> Unit)

Specifies the block handler for every HTTP response.

Link copied to clipboard
fun transformRequestBody(block: suspend TransformRequestBodyContext.(request: HttpRequestBuilder, content: Any, bodyType: TypeInfo?) -> OutgoingContent?)

Specifies the block transformer for a request body.

Link copied to clipboard
fun transformResponseBody(block: suspend TransformResponseBodyContext.(response: HttpResponse, content: ByteReadChannel, requestedType: TypeInfo) -> Any?)

Specifies the block transformer for a response body.