restQuery

fun <T, I, Q> restQuery(resource: Resource<T, I>, url: String, initialId: I, contentType: String = "application/json; charset=utf-8", buildQuery: suspend Request.(Q) -> Response = { accept(contentType).get() }): QueryRepository<T, I, Q>

provides services to deal with queries for REST-API to a defined Resource

Parameters

resource

definition of the Resource

url

base-url of the REST-API

initialId

id to compare a given resource for differentiation of adding or updating

contentType

to be used by the REST-API

buildQuery

function to build a Request for a given object defining the query

fun <T, I, Q> restQuery(resource: Resource<T, I>, remote: Request, initialId: I, contentType: String = "application/json; charset=utf-8", buildQuery: suspend Request.(Q) -> Response = { accept(contentType).get() }): QueryRepository<T, I, Q>

provides services to deal with queries for REST-API to a defined Resource

Parameters

resource

definition of the Resource

remote

base Request to be used by all subsequent requests. Use it to configure authentication, etc.

initialId

id to compare a given resource for differentiation of adding or updating

contentType

to be used by the REST-API

buildQuery

function to build a Request for a given object defining the query