Builder

class Builder

Builder class for Ktorfit.

See also

Constructors

Builder
Link copied to clipboard
fun Builder()

Functions

baseUrl
Link copied to clipboard
fun baseUrl(url: String): <ERROR CLASS>

That will be used for every request with object

build
Link copied to clipboard
fun build(): Ktorfit

Creates an instance of Ktorfit with specified baseUrl and HttpClient.

fun build(builder: Ktorfit.Builder.() -> Unit): <ERROR CLASS>

Apply changes to builder and get the Ktorfit instance without the need of calling build afterwards.

httpClient
Link copied to clipboard
fun httpClient(client: <ERROR CLASS>): <ERROR CLASS>

Client that will be used for every request with object

fun httpClient(engine: <ERROR CLASS>): <ERROR CLASS>

Build HttpClient by just passing an engine

fun httpClient(config: <ERROR CLASS><out <ERROR CLASS>>.() -> Unit): <ERROR CLASS>

Client-Builder that will be used for every request with object

fun httpClient(engine: <ERROR CLASS>, config: <ERROR CLASS><out <ERROR CLASS>>.() -> Unit): <ERROR CLASS>

Client-Builder with engine that will be used for every request with object

responseConverter
Link copied to clipboard
fun responseConverter(vararg converter: ResponseConverter): <ERROR CLASS>

Use this to add ResponseConverter for unsupported return types of requests