ApiClient

interface ApiClient

The minimal request contract. Mirrors SwiftyNetwork's APIClient.

The single core method is type-erased (it takes Ktor TypeInfo) so it can live on an interface; prefer the reified request extensions below for ergonomic call sites.

Inheritors

Functions

Link copied to clipboard
suspend fun ApiClient.execute(endpoint: NetworkEndpoint)

Executes endpoint, discarding any response body.

Link copied to clipboard
abstract suspend fun <T> request(endpoint: NetworkEndpoint, body: Any?, bodyType: TypeInfo?, responseType: TypeInfo): T

Executes endpoint, optionally sending body (described by bodyType), and decodes the response into responseType.

Link copied to clipboard
inline suspend fun <T> ApiClient.request(endpoint: NetworkEndpoint): T

Executes endpoint and decodes the response into T.

inline suspend fun <B, T> ApiClient.request(endpoint: NetworkEndpoint, body: B): T

Executes endpoint sending body of type B, and decodes the response into T.