August 2019
Intermediate to advanced
560 pages
13h 41m
English
We can send a request either synchronously or asynchronously. In synchronous mode, the calling thread is blocked until a response is received. In asynchronous mode, we provide a ResponseListener object with two callback methods, the onSuccess and onFailure methods, to be notified when the request completes. The declaration of the synchronous request method is shown in the following code snippet:
public Response performRequest(Request request) throws java.io.IOException
The declaration of the asynchronous request method is shown in the following code snippet:
public void performRequestAsync(Request request, ResponseListener responseListener)
Before we can send out the request, we have to construct ...
Read now
Unlock full access