com.worklight.wlclient.api
Interface WLHttpResponseListener
-
public interface WLHttpResponseListener
This interface defines methods that the listener for the resource request implements to receive notifications about the success or failure of the request.
-
-
Method Summary
Methods Modifier and Type Method and Description void
onFailure(org.apache.http.HttpResponse response, java.lang.Exception e)
Called if any failure occurred during the execution of theWLClient.sendRequest(HttpUriRequest request, WLHttpResponseListener listener)
or one of the send methods ofWLResourceRequest
.void
onSuccess(org.apache.http.HttpResponse response)
Called following successful calls to theWLClient.sendRequest(HttpUriRequest request, WLHttpResponseListener listener)
or one of the send methods ofWLResourceRequest
.
-
-
-
Method Detail
-
onSuccess
void onSuccess(org.apache.http.HttpResponse response)
Called following successful calls to theWLClient.sendRequest(HttpUriRequest request, WLHttpResponseListener listener)
or one of the send methods ofWLResourceRequest
.A successful response is any response received from the server that contains a status in the 2xx range. Note: Unlike the
WLResponseListener.onSuccess(com.worklight.wlclient.api.WLResponse)
method, this method is given the raw HTTP response. MobileFirst Platform does not attempt to read or process the content of this response in any way.- Parameters:
response
- HTTP response that was received from the server.
-
onFailure
void onFailure(org.apache.http.HttpResponse response, java.lang.Exception e)
Called if any failure occurred during the execution of theWLClient.sendRequest(HttpUriRequest request, WLHttpResponseListener listener)
or one of the send methods ofWLResourceRequest
.There are two possible types of failure that are handled by this method:
- A response with a status of 4xx or 5xx was received. In this event, the response is delivered to this method.
- No response was received from the server. In this event, there is no response to hand to this method, and the response parameter is null. An exception object detailing the cause of the failure is given instead.
- Parameters:
response
- HTTP response that was received from the server, or null if no response was received.e
- Exception object detailing the cause of the failure, or null if a response was received.
-
-