AbstractRestClient
abstract class AbstractRestClient(val json: Json, val client: HttpClient, val baseUrl: String, val mapError: context(Raise<RestClientErrorSpec>) suspend HttpResponse.() -> RestClientErrorSpec)(source)
Represents an abstract REST client providing helper methods to perform HTTP operations such as GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS. This class handles request execution, error transformation, and response deserialization.
Inheritors
Constructors
Link copied to clipboard
constructor(json: Json, client: HttpClient, baseUrl: String, mapError: context(Raise<RestClientErrorSpec>) suspend HttpResponse.() -> RestClientErrorSpec)
Properties
Functions
Link copied to clipboard
context(_: Raise<RestClientErrorSpec>)
inline suspend fun <T> postMultipart(uri: String, data: ByteArray, fileName: String = "file", contentType: ContentType = ContentType.Application.OctetStream, crossinline builder: HttpRequestBuilder.() -> Unit = {}): T
inline suspend fun <T> postMultipart(uri: String, data: ByteArray, fileName: String = "file", contentType: ContentType = ContentType.Application.OctetStream, crossinline builder: HttpRequestBuilder.() -> Unit = {}): T