remoteRequest

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

Makes a remote call to the remote server.

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


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

Makes a remote call to the remote server.

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


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

Makes a remote call to the remote server.

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


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

Makes a remote call to the remote server.

Return

a promise of the response

Parameters

url

an URL address

serializer

for the data

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