HttpResponder
public class NativeHttpRequest extends java.lang.Object implements HttpResponder
Modifier and Type | Method | Description |
---|---|---|
void |
cancel() |
|
void |
handleFailure(int type,
java.lang.String errorMessage) |
Invoked when a resource failed to be retrieved.
|
void |
onResponse(int responseCode,
java.lang.String etag,
java.lang.String lastModified,
java.lang.String cacheControl,
java.lang.String expires,
java.lang.String retryAfter,
java.lang.String xRateLimitReset,
byte[] body) |
Invoked when a resource has finished.
|
public void cancel()
public void onResponse(int responseCode, java.lang.String etag, java.lang.String lastModified, java.lang.String cacheControl, java.lang.String expires, java.lang.String retryAfter, java.lang.String xRateLimitReset, byte[] body)
HttpResponder
onResponse
in interface HttpResponder
responseCode
- http response codeetag
- http header, identifier for a specific version of a resourcelastModified
- http header, used to determine if a resource hasn't been modified sincecacheControl
- http header, used to determine cache strategy of a resourceexpires
- http header, used to determine when a resource is staleretryAfter
- http header, used to indicate when the service is expected to be unavailable to the clientxRateLimitReset
- http header, used to determine the remaining window before the rate limit resetsbody
- http response body, in an array of bytes representationpublic void handleFailure(int type, java.lang.String errorMessage)
HttpResponder
handleFailure
in interface HttpResponder
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