Package com.mapbox.mapboxsdk.module.http

Contains the Mapbox Maps Android Modular Http API classes.

Types

Name Summary
HttpRequestImpl
open class HttpRequestImpl : HttpRequest
HttpRequestUtil
open class HttpRequestUtil
Utility class for setting OkHttpRequest configurations

HttpRequestImpl

open class HttpRequestImpl : HttpRequest

Functions

Name Summary
cancelRequest
open fun cancelRequest()
Cancels the request.
enableLog
open fun enableLog(enabled: Boolean)
enablePrintRequestUrlOnFailure
open fun enablePrintRequestUrlOnFailure(enabled: Boolean)
executeRequest
abstract fun executeRequest(httpRequest: HttpResponder, nativePtr: Long, resourceUrl: String, etag: String, modified: String, offlineUsage: Boolean)
open fun executeRequest(httpRequest: HttpResponder, nativePtr: Long, resourceUrl: String, etag: String, modified: String, offlineUsage: Boolean)
Executes the request.
setOkHttpClient
open fun setOkHttpClient(okHttpClient: OkHttpClient)

Properties

Name Summary
client open val client: OkHttpClient
DEFAULT_CLIENT val DEFAULT_CLIENT: OkHttpClient

DEFAULT_CLIENT

val DEFAULT_CLIENT: OkHttpClient

cancelRequest

open fun cancelRequest()

Cancels the request.

client

open val client: OkHttpClient

enableLog

open fun enableLog(enabled: Boolean)

enablePrintRequestUrlOnFailure

open fun enablePrintRequestUrlOnFailure(enabled: Boolean)

executeRequest

open fun executeRequest(httpRequest: HttpResponder, nativePtr: Long, resourceUrl: String, etag: String, modified: String, offlineUsage: Boolean)

Executes the request.

Parameters
Name Summary
httpRequest
callback to be invoked when we receive a response
nativePtr
the pointer associated to the request
resourceUrl
the resource url to download
etag
http header, identifier for a specific version of a resource
modified
http header, used to determine if a resource hasn’t been modified since
offlineUsage
flag to indicate a resource will be used for offline, appends offline=true as a query parameter
   
   

setOkHttpClient

open fun setOkHttpClient(okHttpClient: OkHttpClient)

HttpRequestUtil

open class HttpRequestUtil

Utility class for setting OkHttpRequest configurations

Functions

Name Summary
setLogEnabled
open fun setLogEnabled(enabled: Boolean)
Set the log state of OkHttpRequest.
setOkHttpClient
open fun setOkHttpClient(client: OkHttpClient)
Set the OkHttpClient used for requesting map resources.
setPrintRequestUrlOnFailure
open fun setPrintRequestUrlOnFailure(enabled: Boolean)
Enable printing of the request url when an error occurred.
toHumanReadableAscii
@NonNull()
open fun toHumanReadableAscii(s: String): String

setLogEnabled

open fun setLogEnabled(enabled: Boolean)

Set the log state of OkHttpRequest. Default value is true.

This configuration will outlast the lifecycle of the Map.

Parameters
Name Summary
enabled
True will enable logging, false will disable
   
   

setOkHttpClient

open fun setOkHttpClient(client: OkHttpClient)

Set the OkHttpClient used for requesting map resources.

This configuration survives across mapView instances.Reset the OkHttpClient to the default by passing null as parameter.

Parameters
Name Summary
client
the OkHttpClient
   
   

setPrintRequestUrlOnFailure

open fun setPrintRequestUrlOnFailure(enabled: Boolean)

Enable printing of the request url when an error occurred. Default value is false.

Requires setLogEnabled to be activated.

This configuration will outlast the lifecycle of the Map.

Parameters
Name Summary
enabled
True will print urls, false will disable
   
   

toHumanReadableAscii

@NonNull()

open fun toHumanReadableAscii(s: String): String