HttpClient

external class HttpClient(source)

Constructors

Link copied to clipboard
constructor(userAgent: String = definedExternally, handlers: ERROR CLASS: Symbol not found for ReadonlyArray<actions/http/client/RequestHandler> = definedExternally, requestOptions: RequestOptions = definedExternally)

Properties

Link copied to clipboard
var handlers: ERROR CLASS: Symbol not found for ReadonlyArray<actions/http/client/RequestHandler>
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun del(requestUrl: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun dispose()

Needs to be called if keepAlive is set to true in request options.

Link copied to clipboard
fun get(requestUrl: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun getAgent(serverUrl: String): ERROR CLASS: Symbol not found for node.http.Agent

Gets an http agent. This function is useful when you need an http agent that handles routing through a proxy server - depending upon the url and proxy environment variables.

Link copied to clipboard
fun getAgentDispatcher(serverUrl: String): Any?
Link copied to clipboard
fun <T> getJson(requestUrl: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/TypedResponse<T>>

Gets a typed object from an endpoint Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise

Link copied to clipboard
fun head(requestUrl: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun options(requestUrl: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun patch(requestUrl: String, data: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun <T> patchJson(requestUrl: String, obj: Any?, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/TypedResponse<T>>
Link copied to clipboard
fun post(requestUrl: String, data: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun <T> postJson(requestUrl: String, obj: Any?, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/TypedResponse<T>>
Link copied to clipboard
fun put(requestUrl: String, data: String, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>
Link copied to clipboard
fun <T> putJson(requestUrl: String, obj: Any?, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/TypedResponse<T>>
Link copied to clipboard
fun request(verb: String, requestUrl: String, data: ERROR CLASS: Symbol not found for node.ReadableStream??, headers: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>

fun request(verb: String, requestUrl: String, data: String?, headers: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>

Makes a raw http request. All other methods such as get, post, patch, and request ultimately call this. Prefer get, del, post and patch

Link copied to clipboard
fun requestRaw(info: RequestInfo, data: ERROR CLASS: Symbol not found for node.ReadableStream??): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>

fun requestRaw(info: RequestInfo, data: String?): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>

Raw request.

Link copied to clipboard
fun requestRawWithCallback(info: RequestInfo, data: ERROR CLASS: Symbol not found for node.ReadableStream??, onResult: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for JsError??, res: HttpClientResponse?) -> Unit)

fun requestRawWithCallback(info: RequestInfo, data: String?, onResult: (@R|kotlin/ParameterName|(name = String(err)) ERROR CLASS: Symbol not found for JsError??, res: HttpClientResponse?) -> Unit)

Raw request with callback.

Link copied to clipboard
fun sendStream(verb: String, requestUrl: String, stream: ERROR CLASS: Symbol not found for node.ReadableStream, additionalHeaders: ERROR CLASS: Symbol not found for node.http.OutgoingHttpHeaders = definedExternally): ERROR CLASS: Symbol not found for Promise<actions/http/client/HttpClientResponse>