Class HttpRequestUtil
java.lang.Object
com.trimblemaps.mapsdk.module.http.HttpRequestUtil
Utility class for setting OkHttpRequest configurations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetLogEnabled(boolean enabled) Set the log state of OkHttpRequest.static voidsetOkHttpClient(okhttp3.OkHttpClient client) Set the OkHttpClient used for requesting map resources.static voidsetPrintRequestUrlOnFailure(boolean enabled) Enable printing of the request url when an error occurred.
-
Constructor Details
-
HttpRequestUtil
public HttpRequestUtil()
-
-
Method Details
-
setLogEnabled
public static void setLogEnabled(boolean enabled) Set the log state of OkHttpRequest. Default value is true.This configuration will outlast the lifecycle of the Map.
- Parameters:
enabled- True will enable logging, false will disable
-
setPrintRequestUrlOnFailure
public static void setPrintRequestUrlOnFailure(boolean enabled) Enable printing of the request url when an error occurred. Default value is false.Requires
setLogEnabled(boolean)to be activated.This configuration will outlast the lifecycle of the Map.
- Parameters:
enabled- True will print urls, false will disable
-
setOkHttpClient
public static void setOkHttpClient(@Nullable okhttp3.OkHttpClient client) 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:
client- the OkHttpClient
-