ArcGISHttpClient

Execute HTTP network requests to ArcGIS resources with this object. The ArcGISHttpClient takes care of authentication with Network- and ArcGIS-secured resources. A singleton instance of ArcGISHttpClient can be obtained from ArcGISEnvironment.arcGISHttpClient.

Since

200.0.0

See also

Types

Link copied to clipboard
class Builder

A builder to create and configure an ArcGISHttpClient instance.

Link copied to clipboard
abstract class Cache

A cache used for storing HTTP responses.

Properties

Link copied to clipboard

The HTTP Cache used for this client.

Link copied to clipboard

Indicates if ArcGISHttpClient.close has been called. The ArcGISHttpClient must not be used anymore once it is closed.

Functions

Link copied to clipboard

Adds an additional HTTP request header with the name name and value value to all outgoing requests.

Link copied to clipboard
open override fun close()

Shuts down the ArcGISHttpClient and releases resources such as HTTP connections.

Link copied to clipboard
suspend fun download(url: String, destinationFile: File, queryParameters: Iterable<Request.Parameter> = emptyList(), progressListener: (totalBytes: Long?, bytesRead: Long) -> Unit? = null): Result<Unit>

Downloads a file from the given URL to the specified destination and reports the progress.

Link copied to clipboard
suspend fun execute(request: Request): Result<Response>

Executes the specified http Request and suspends until a Response has been received. Any exception thrown when executing the http request is caught and returned as a failure Result object, except CancellationExceptions caused by cancelling the running coroutine.