Ktorfit

class Ktorfit(baseUrl: String, httpClient: HttpClient)

Main class for Ktorfit, create the class than use the create() function.

Parameters

baseUrl

that will be used for every request with object

httpClient

client that will be used for every request with object

Constructors

Ktorfit
Link copied to clipboard
fun Ktorfit(baseUrl: String, httpClient: HttpClient = HttpClient())

Functions

addAdapter
Link copied to clipboard
fun addAdapter(callAdapter: CallAdapter): Ktorfit

Use this to add CallAdapter for unsupported return types of requests

getAdapterList
Link copied to clipboard
fun getAdapterList(): MutableList<CallAdapter>

Properties

baseUrl
Link copied to clipboard
val baseUrl: String
httpClient
Link copied to clipboard
var httpClient: HttpClient

Extensions

create
Link copied to clipboard
inline fun <T> Ktorfit.create(): T

This will make IntelliJ think that this function exists. The real implementation will be generated by the KSP plugin Ktorfit will return a implementation of type T for a requested interface