patch

inline suspend fun <B, R> HttpFetcher.patch(resource: 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(source)

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

You can set R to Unit if this request doesn't expect a response body.

See also tryPatch, which will return null if the request fails for any reason.

Note: you should NOT prepend your path with "api/", as that will be added automatically.

Parameters

body

The body to send with the request. Make sure your class is marked with @Serializable or provide a custom bodySerializer.


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

A serialize-friendly version of patch that expects a body but does not expect a serialized response.


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

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