Package-level declarations

Functions

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

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

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

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

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

Call HEAD on a target resource with R as the expected return type.

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

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

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

A serialize-friendly version of patch that doesn't put any type constraints on the body.

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

Call PATCH on a target resource with B as the body type and R as the expected return type.

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

A serialize-friendly version of post that doesn't put any type constraints on the body.

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

Call POST on a target resource with B as the body type and R as the expected return type.

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

A serialize-friendly version of put that doesn't put any type constraints on the body.

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

Call PUT on a target resource with B as the body type and R as the expected return type.

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

Like delete, but returns null if the request failed for any reason.

Link copied to clipboard
inline suspend fun <R> HttpFetcher.tryGet(resource: 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 failed for any reason.

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

Like head, but returns null if the request failed for any reason.

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

Like options, but returns null if the request failed for any reason.

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

A serialize-friendly version of tryPatch that doesn't put any type constraints on the body.

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

Like patch, but returns null if the request failed for any reason.

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

A serialize-friendly version of tryPost that doesn't put any type constraints on the body.

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

Like post, but returns null if the request failed for any reason.

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

A serialize-friendly version of tryPut that doesn't put any type constraints on the body.

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

Like put, but returns null if the request failed for any reason.