inline fun <reified 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.
contentType
- a content type of the request
beforeSend
- a function to set request parameters
transform
- a function to transform the result of the call
Return
a promise of the response
inline fun <reified V : Any> request(url: String, data: V, method: HttpMethod = HttpMethod.GET, contentType: String = "application/json", noinline beforeSend: ((JQueryXHR, JQueryAjaxSettings) -> Boolean)? = null): Promise<Response<dynamic>>
Helper inline function to automatically get serializer for the data.
contentType
- a content type of the request
beforeSend
- a function to set request parameters
Return
a promise of the response
inline fun <T : Any, reified 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.
deserializer
- a deserializer for the result value
contentType
- a content type of the request
beforeSend
- a function to set request parameters
transform
- a function to transform the result of the call
Return
a promise of the response
inline fun <reified 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.
contentType
- a content type of the request
beforeSend
- a function to set request parameters
transform
- a function to transform the result of the call
Return
a promise of the response
inline fun <reified T : Any, reified 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.
contentType
- a content type of the request
beforeSend
- a function to set request parameters
transform
- a function to transform the result of the call
Return
a promise of the response