HttpServiceInterface

interface HttpServiceInterface

Interface to the HTTP service. This interface provides basic functionality that allows exchanging HTTP requests/responses between client and server in an asynchronous way.

Functions

cancelRequest
Link copied to clipboard
abstract fun cancelRequest(id: Long, @NonNull callback: ResultCallback)
Cancels a pending or running request (or download request).
download
Link copied to clipboard
abstract fun download(@NonNull options: DownloadOptions, @NonNull callback: DownloadStatusCallback): Long
Send the download request.
request
Link copied to clipboard
abstract fun request(@NonNull request: HttpRequest, @NonNull callback: HttpResponseCallback): Long
Sends (or enqueues) a platform's native HTTP Request.
setInterceptor
Link copied to clipboard
abstract fun setInterceptor(@Nullable interceptor: HttpServiceInterceptorInterface)
Set an interceptor for the HttpService's function calls.
setMaxRequestsPerHost
Link copied to clipboard
abstract fun setMaxRequestsPerHost(max: Byte)
Set maximum number of requests to a single host.
supportsKeepCompression
Link copied to clipboard
abstract fun supportsKeepCompression(): Boolean
Returns true when the HTTP service supports the keepCompression flag for HTTP requests, false otherwise.