Class NativeHttpRequest

java.lang.Object
com.trimblemaps.mapsdk.http.NativeHttpRequest
All Implemented Interfaces:
HttpResponder

public class NativeHttpRequest extends Object implements HttpResponder
  • Method Details

    • cancel

      public void cancel()
    • onResponse

      public void onResponse(int responseCode, String etag, String lastModified, String cacheControl, String expires, String retryAfter, String xRateLimitReset, byte[] body)
      Description copied from interface: HttpResponder
      Invoked when a resource has finished.
      Specified by:
      onResponse in interface HttpResponder
      Parameters:
      responseCode - http response code
      etag - http header, identifier for a specific version of a resource
      lastModified - http header, used to determine if a resource hasn't been modified since
      cacheControl - http header, used to determine cache strategy of a resource
      expires - http header, used to determine when a resource is stale
      retryAfter - http header, used to indicate when the service is expected to be unavailable to the client
      xRateLimitReset - http header, used to determine the remaining window before the rate limit resets
      body - http response body, in an array of bytes representation
    • handleFailure

      public void handleFailure(int type, String errorMessage)
      Description copied from interface: HttpResponder
      Invoked when a resource failed to be retrieved.
      Specified by:
      handleFailure in interface HttpResponder
      Parameters:
      type - the error type, either one of HttpRequest.CONNECTION_ERROR, HttpRequest.TEMPORARY_ERROR or HttpRequest.PERMANENT_ERROR
      errorMessage - the error message associated with the failure