vncore / com.venuenext.vncore.protocol / HttpInterface

HttpInterface

interface HttpInterface

HttpInterface VenueNext

Created on 1/23/19. Copyright © 2019 VenueNext Inc. All rights reserved.

Parameters

T - the type of serialized result data.

Functions

call

Makes an HTTP request call, and serializes response.

abstract fun <T : Any> call(request: HttpRequest, serializer: KSerializer<T>? = null): HttpResponse<T>
abstract fun <T : Any> call(request: HttpRequest, serializer: KSerializer<T>? = null, success: (result: HttpResponse<T>) -> Unit, failure: (Exception) -> Unit): Unit

readInputStream

Reads response byte array to connection input stream.

abstract fun readInputStream(connection: HttpURLConnection): String

setRequestHeaders

Sets request headers in URL connection.

abstract fun setRequestHeaders(connection: HttpURLConnection, request: HttpRequest): Unit

writeBody

Writes body byte array to output stream.

abstract fun writeBody(connection: HttpURLConnection, request: HttpRequest): Unit

Inheritors

HttpClient

open class HttpClient : HttpInterface