Package-level declarations
RESTful API client with support for type-safe connectivity.
Types
Link copied to clipboard
class BadGateway(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class BadRequest(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class Forbidden(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
HTTP methods.
Link copied to clipboard
class NotAllowed(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class NotFound(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class NotImplemented(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
open class RemoteRequestException(val code: Short, val url: String, val method: HttpMethod, message: String, val response: Response? = null) : Exception
Link copied to clipboard
HTTP response body types.
Link copied to clipboard
A HTTP REST client
Link copied to clipboard
class RestClientConfig
REST Client configuration
Link copied to clipboard
REST request configuration
Link copied to clipboard
A response wrapper
Link copied to clipboard
class ServerError(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class ServiceUnavailable(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class Unauthorized(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Link copied to clipboard
class XHRError(val url: String, val method: HttpMethod, message: String, val response: Response? = null) : RemoteRequestException
Code 0 does not represent any http status, it represent XHR error (e.g. network error, CORS failure).
Properties
Functions
Link copied to clipboard
inline fun <T : Any> RestClient.call(url: String, crossinline block: RestRequestConfig<T, dynamic>.() -> Unit = {}): Promise<T>
inline fun <T : Any, V : Any> RestClient.call(url: String, data: V, crossinline block: RestRequestConfig<T, V>.() -> Unit = {}): Promise<T>
Makes a http request to the server, returning data directly.
Link copied to clipboard
fun RestClient.callDynamic(url: String, block: RestRequestConfig<dynamic, dynamic>.() -> Unit = {}): Promise<dynamic>
inline fun <V : Any> RestClient.callDynamic(url: String, data: V, crossinline block: RestRequestConfig<dynamic, V>.() -> Unit = {}): Promise<dynamic>
Makes a http request to the server, returning data directly.
Link copied to clipboard
inline fun <V : Any> RestClient.postDynamic(url: String, data: V, crossinline block: RestRequestConfig<dynamic, V>.() -> Unit = {}): Promise<dynamic>
Makes a http POST request to the server, returning data directly.
Link copied to clipboard
inline fun <T : Any> RestClient.request(url: String, crossinline block: RestRequestConfig<T, dynamic>.() -> Unit = {}): Promise<RestResponse<T>>
inline fun <T : Any, V : Any> RestClient.request(url: String, data: V, crossinline block: RestRequestConfig<T, V>.() -> Unit = {}): Promise<RestResponse<T>>
Makes a http request to the server, returning the response object.
Link copied to clipboard
fun RestClient.requestDynamic(url: String, block: RestRequestConfig<dynamic, dynamic>.() -> Unit = {}): Promise<RestResponse<dynamic>>
inline fun <V : Any> RestClient.requestDynamic(url: String, data: V, crossinline block: RestRequestConfig<dynamic, V>.() -> Unit = {}): Promise<RestResponse<dynamic>>
Makes a http request to the server, returning the response object.