RestClient

class RestClient<K>(config: ClientConfig, tokenProvider: TokenProvider, responseHandler: RestResponseHandler<K>, prometheus: MeterRegistry = SimpleMeterRegistry())(source)

Parameters

prometheus

Send inn en Prometheus-instans for å få RestClient-klassen til å generere histogrammer over request-tid.

Constructors

Link copied to clipboard
constructor(config: ClientConfig, tokenProvider: TokenProvider, responseHandler: RestResponseHandler<K>, prometheus: MeterRegistry = SimpleMeterRegistry())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun <R> delete(uri: URI, request: DeleteRequest, mapper: (K, HttpHeaders) -> R): R?
Link copied to clipboard
fun <T : Any, R> deleteMedBody(uri: URI, request: DeleteMedBodyRequest<T>, mapper: (K, HttpHeaders) -> R): R?
Link copied to clipboard
fun <R> get(uri: URI, request: GetRequest, mapper: (K, HttpHeaders) -> R): R?
Link copied to clipboard
inline fun <R> RestClient<InputStream>.get(uri: URI, request: GetRequest): R?
Link copied to clipboard
fun <T : Any, R> patch(uri: URI, request: PatchRequest<T>, mapper: (K, HttpHeaders) -> R): R?
Link copied to clipboard
inline fun <T : Any, R> RestClient<InputStream>.patch(uri: URI, request: PatchRequest<T>): R?
Link copied to clipboard
fun <T : Any, R> post(uri: URI, request: PostRequest<T>, mapper: (K, HttpHeaders) -> R): R?
Link copied to clipboard
inline fun <T : Any, R> RestClient<InputStream>.post(uri: URI, request: PostRequest<T>): R?
Link copied to clipboard
fun <T : Any, R> put(uri: URI, request: PutRequest<T>, mapper: (K, HttpHeaders) -> R): R?
Link copied to clipboard
inline fun <T : Any, R> RestClient<InputStream>.put(uri: URI, request: PutRequest<T>): R?
Link copied to clipboard
fun <R> retryableGet(uri: URI, request: GetRequest, mapper: (K, HttpHeaders) -> R, maxRetries: Int = 2): R?
Link copied to clipboard
inline fun <R> RestClient<InputStream>.retryableGet(uri: URI, request: GetRequest): R?
Link copied to clipboard
fun <T : Any, R> retryablePost(uri: URI, request: PostRequest<T>, mapper: (K, HttpHeaders) -> R, maxRetries: Int = 2): R?
Link copied to clipboard
inline fun <T : Any, R> RestClient<InputStream>.retryablePost(uri: URI, request: PostRequest<T>): R?