HttpClient
class HttpClient(adapter: HttpClientPort, val settings: HttpClientSettings = HttpClientSettings(), val handler: HttpHandler? = null) : Closeable
Client to use other REST services.
Constructors
Link copied to clipboard
constructor(adapter: HttpClientPort, settings: HttpClientSettings = HttpClientSettings(), handler: HttpHandler? = null)
Functions
Link copied to clipboard
Link copied to clipboard
fun delete(path: String = "", body: Any? = null, contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
fun get(path: String = "", headers: Headers = Headers(), body: Any? = null, contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
Link copied to clipboard
fun options(path: String = "", body: Any? = null, headers: Headers = Headers(), contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
fun patch(path: String = "", body: Any? = null, contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
fun post(path: String = "", body: Any? = null, contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
fun put(path: String = "", body: Any? = null, contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
Link copied to clipboard
Synchronous execution.
Link copied to clipboard
Link copied to clipboard
fun trace(path: String = "", body: Any? = null, contentType: ContentType? = settings.contentType, accept: List<ContentType> = settings.accept): HttpResponsePort
Link copied to clipboard
fun ws(path: String, onConnect: WsSession.() -> Unit = {}, onBinary: WsSession.(data: ByteArray) -> Unit = {}, onText: WsSession.(text: String) -> Unit = {}, onPing: WsSession.(data: ByteArray) -> Unit = {}, onPong: WsSession.(data: ByteArray) -> Unit = {}, onClose: WsSession.(status: Int, reason: String) -> Unit = { _, _ -> }): WsSession