LegacyRestClient

open class LegacyRestClient(module: SerializersModule?)

An agent responsible for remote calls.

Constructors

LegacyRestClient
Link copied to clipboard
fun LegacyRestClient(module: SerializersModule? = null)

Functions

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

Helper inline function to automatically get serializer for the data.

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

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

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

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

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

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

remoteCall
Link copied to clipboard
fun remoteCall(url: String, data: dynamic = null, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: (JQueryXHR, JQueryAjaxSettings) -> Boolean? = null): Promise<dynamic>
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> 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 <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>

Makes a remote call to the remote server.

remoteRequest
Link copied to clipboard
fun remoteRequest(url: String, data: dynamic = null, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", beforeSend: (JQueryXHR, JQueryAjaxSettings) -> Boolean? = null): Promise<Response<dynamic>>
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> 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 <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>>

Makes a remote call to the remote server.

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

Helper inline function to automatically get serializer for the data.

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

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

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

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

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

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