request

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

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

Return

a promise of the response

Parameters

url

an URL address

data

data to be sent

method

a HTTP method

contentType

a content type of the request

beforeSend

a function to set request parameters

transform

a function to transform the result of the call


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

Helper inline function to automatically get serializer for the data.

Return

a promise of the response

Parameters

url

an URL address

data

data to be sent

method

a HTTP method

contentType

a content type of the request

beforeSend

a function to set request parameters


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

Helper inline function to automatically get serializer for the data.

Return

a promise of the response

Parameters

url

an URL address

data

data to be sent

deserializer

a deserializer for the result value

method

a HTTP method

contentType

a content type of the request

beforeSend

a function to set request parameters

transform

a function to transform the result of the call


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

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

Return

a promise of the response

Parameters

url

an URL address

serializer

for the data

data

data to be sent

method

a HTTP method

contentType

a content type of the request

beforeSend

a function to set request parameters

transform

a function to transform the result of the call


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

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

Return

a promise of the response

Parameters

url

an URL address

data

data to be sent

method

a HTTP method

contentType

a content type of the request

beforeSend

a function to set request parameters

transform

a function to transform the result of the call