kvision / pl.treksoft.kvision.rest / RestClient

RestClient

(js) open class RestClient

An agent responsible for remote calls.

Constructors

(js)

<init>

An agent responsible for remote calls.

RestClient()

Functions

(js)

call

Helper inline function to automatically get deserializer for the result value with dynamic data.

fun <T : Any> call(url: String, data: dynamic = null, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<T>

Helper inline function to automatically get serializer for the data.

fun <V : Any> call(url: String, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<dynamic>
fun <T : Any, V : Any> call(url: String, data: V, deserializer: DeserializationStrategy<T>, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<T>

Helper inline function to automatically deserializer for the result value with typed data.

fun <T : Any, V : Any> call(url: String, serializer: SerializationStrategy<V>, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<T>

Helper inline function to automatically get serializer for the data and deserializer for the result value.

fun <T : Any, V : Any> call(url: String, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<T>
(js)

remoteCall

Makes a remote call to the remote server.

fun remoteCall(url: String, data: dynamic = null, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<dynamic>
fun <T : Any> remoteCall(url: String, data: dynamic = null, deserializer: DeserializationStrategy<T>, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<T>
fun <V : Any> remoteCall(url: String, serializer: SerializationStrategy<V>, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<dynamic>
fun <T : Any, V : Any> remoteCall(url: String, serializer: SerializationStrategy<V>, data: V, deserializer: DeserializationStrategy<T>, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<T>
(js)

remoteRequest

Makes a remote call to the remote server.

fun remoteRequest(url: String, data: dynamic = null, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<Response<dynamic>>
fun <T : Any> remoteRequest(url: String, data: dynamic = null, deserializer: DeserializationStrategy<T>, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<Response<T>>
fun <V : Any> remoteRequest(url: String, serializer: SerializationStrategy<V>, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<Response<dynamic>>
fun <T : Any, V : Any> remoteRequest(url: String, serializer: SerializationStrategy<V>, data: V, deserializer: DeserializationStrategy<T>, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<Response<T>>
(js)

request

Helper inline function to automatically get deserializer for the result value with dynamic data.

fun <T : Any> request(url: String, data: dynamic = null, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<Response<T>>

Helper inline function to automatically get serializer for the data.

fun <V : Any> request(url: String, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<Response<dynamic>>
fun <T : Any, V : Any> request(url: String, data: V, deserializer: DeserializationStrategy<T>, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<Response<T>>

Helper inline function to automatically deserializer for the result value with typed data.

fun <T : Any, V : Any> request(url: String, serializer: SerializationStrategy<V>, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<Response<T>>

Helper inline function to automatically get serializer for the data and deserializer for the result value.

fun <T : Any, V : Any> request(url: String, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null, transform: ((dynamic) -> dynamic)? = null): Promise<Response<T>>