EntryEndpoint

constructor(uri: URI, httpClient: OkHttpClient, serializers: List<Serializer>, errorHandler: ErrorHandler = DefaultErrorHandler(), linkExtractor: LinkExtractor = AggregateLinkExtractor(HeaderLinkExtractor(), HalLinkExtractor()))

Creates a new entry endpoint.

Parameters

uri

The base URI of the REST API. Missing trailing slash will be appended automatically.

httpClient

The HTTP client used to communicate with the REST API.

serializers

A list of serializers used for entities received from the server, sorted from most to least preferred. Always uses first for sending to the server.

errorHandler

Handles errors in HTTP responses.

linkExtractor

Detects links in HTTP responses.


constructor(uri: URI, httpClient: OkHttpClient, serializer: Serializer = KotlinxJsonSerializer(), errorHandler: ErrorHandler = DefaultErrorHandler(), linkExtractor: LinkExtractor = AggregateLinkExtractor(HeaderLinkExtractor(), HalLinkExtractor()))

Creates a new entry endpoint.

Parameters

uri

The base URI of the REST API. Missing trailing slash will be appended automatically.

httpClient

The HTTP client used to communicate with the REST API.

serializer

The serializer used for entities sent to and received from the server.

errorHandler

Handles errors in HTTP responses.

linkExtractor

Detects links in HTTP responses.


constructor(uri: URI, credentials: HttpCredentials? = null, serializer: Serializer = KotlinxJsonSerializer(), errorHandler: ErrorHandler = DefaultErrorHandler(), linkExtractor: LinkExtractor = AggregateLinkExtractor(HeaderLinkExtractor(), HalLinkExtractor()))

Creates a new entry endpoint.

Parameters

uri

The base URI of the REST API.

credentials

Optional HTTP Basic authentication credentials used to authenticate against the REST API.

serializer

The serializer used for entities sent to and received from the server.

errorHandler

Handles errors in HTTP responses.

linkExtractor

Detects links in HTTP responses.