Package-level declarations

Functions

Link copied to clipboard
inline suspend fun <R> ApiFetcher.delete(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R

Call DELETE on a target API path with R as the expected return type.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.get(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R

Call GET on a target API path with R as the expected return type.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.options(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R

Call OPTIONS on a target API path with R as the expected return type.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.patch(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R

A serialize-friendly version of patch that has no body but provides a serialized response.

inline suspend fun <B> ApiFetcher.patch(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): Response

A version of patch that accepts a serializable body.

inline suspend fun <B, R> ApiFetcher.patch(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), responseDeserializer: DeserializationStrategy<R> = serializer()): R

Call PATCH on a target API path with R as the expected return type.

Link copied to clipboard
inline suspend fun <B> ApiFetcher.patchBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): ByteArray

A serialize-friendly version of patch that accepts a serializable body and returns its response as a raw byte array.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.post(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R

A serialize-friendly version of post that has no body but provides a serialized response.

inline suspend fun <B> ApiFetcher.post(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): Response

A version of post that accepts a serializable body.

inline suspend fun <B, R> ApiFetcher.post(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), responseDeserializer: DeserializationStrategy<R> = serializer()): R

Call POST on a target API path with R as the expected return type.

Link copied to clipboard
inline suspend fun <B> ApiFetcher.postBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): ByteArray

A serialize-friendly version of post that accepts a serializable body and returns its response as a raw byte array.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.put(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R

A serialize-friendly version of put that has no body but provides a serialized response.

inline suspend fun <B> ApiFetcher.put(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): Response

A version of put that accepts a serializable body.

inline suspend fun <B, R> ApiFetcher.put(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), responseDeserializer: DeserializationStrategy<R> = serializer()): R

Call PUT on a target API path with R as the expected return type.

Link copied to clipboard
inline suspend fun <B> ApiFetcher.putBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): ByteArray

A serialize-friendly version of put that accepts a serializable body and returns its response as a raw byte array.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.tryDelete(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R?

A serialize-friendly version of tryDelete.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.tryGet(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R?

Like get, but returns null if the request fails or the response can't be deserialized.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.tryOptions(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R?

A serialize-friendly version of tryOptions.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.tryPatch(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R?

A serialize-friendly version of tryPatch that has no body but provides a serialized response.

inline suspend fun <B> ApiFetcher.tryPatch(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): Response?

Like patch but returns null instead of throwing if the request fails.

inline suspend fun <B, T> ApiFetcher.tryPatch(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), noinline transform: suspend Response.() -> T): T?

A serialize-friendly version of tryPatch that accepts a serializable body and logic to convert the response to some desired target object of type T.

inline suspend fun <B, R> ApiFetcher.tryPatch(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), responseDeserializer: DeserializationStrategy<R> = serializer()): R?

Like patch, but returns null if the request fails or the response can't be deserialized.

Link copied to clipboard
inline suspend fun <B> ApiFetcher.tryPatchBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): ByteArray?

A serialize-friendly version of tryPatch that accepts a serializable body and returns its response as a raw byte array.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.tryPost(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R?

A serialize-friendly version of tryPost that has no body but provides a serialized response.

inline suspend fun <B> ApiFetcher.tryPost(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): Response?

Like post but returns null instead of throwing if the request fails.

inline suspend fun <B, T> ApiFetcher.tryPost(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), noinline transform: suspend Response.() -> T): T?

A serialize-friendly version of tryPost that accepts a serializable body and logic to convert the response to some desired target object of type T.

inline suspend fun <B, R> ApiFetcher.tryPost(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), responseDeserializer: DeserializationStrategy<R> = serializer()): R?

Like post, but returns null if the request fails or the response can't be deserialized.

Link copied to clipboard
inline suspend fun <B> ApiFetcher.tryPostBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): ByteArray?

A version of tryPost that returns its response as a raw byte array.

Link copied to clipboard
inline suspend fun <R> ApiFetcher.tryPut(apiPath: String, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, responseDeserializer: DeserializationStrategy<R> = serializer()): R?

A serialize-friendly version of tryPut that has no body but provides a serialized response.

inline suspend fun <B> ApiFetcher.tryPut(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): Response?

Like put but returns null instead of throwing if the request fails.

inline suspend fun <B, T> ApiFetcher.tryPut(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), noinline transform: suspend Response.() -> T): T?

A serialize-friendly version of tryPut that accepts a serializable body and logic to convert the response to some desired target object of type T.

inline suspend fun <B, R> ApiFetcher.tryPut(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer(), responseDeserializer: DeserializationStrategy<R> = serializer()): R?

Like put, but returns null if the request fails or the response can't be deserialized.

Link copied to clipboard
inline suspend fun <B> ApiFetcher.tryPutBytes(apiPath: String, body: B, headers: Map<String, Any>? = FetchDefaults.Headers, redirect: RequestRedirect? = FetchDefaults.Redirect, abortController: AbortController? = null, bodySerializer: SerializationStrategy<B> = serializer()): ByteArray?

A serialize-friendly version of tryPut that accepts a serializable body and returns its response as a raw byte array.