Controls an HTTP request (GET, PUT, POST etc). Created by
UrlRequest.Builder, which can
be obtained by calling
CronetEngine.newUrlRequestBuilder(String, UrlRequest.Callback, Executor). Note: All methods must be
called on the
Executor passed to
CronetEngine.newUrlRequestBuilder(String, UrlRequest.Callback, Executor).
Nested Class Summary
|class||UrlRequest.Callback||Users of Cronet extend this class to receive callbacks indicating the progress of a
|class||UrlRequest.Status||Request status values returned by
|class||UrlRequest.StatusListener||Listener class used with
Public Constructor Summary
Public Method Summary
Cancels the request.
Follows a pending redirect.
Attempts to read part of the response body into the provided buffer.
Inherited Method Summary
wait(long arg0, int arg1)
public UrlRequest ()
public abstract void cancel ()
Cancels the request. Can be called at any time.
be invoked when cancellation is complete and no further callback methods will be invoked. If
the request has completed or has not started, calling
cancel() has no effect and
onCanceled() will not be invoked. If the
Executor passed in during
UrlRequest construction runs tasks on a single thread, and
cancel() is called on
that thread, no callback methods (besides
onCanceled()) will be invoked after
cancel() is called. Otherwise, at most one callback method may be invoked after
cancel() has completed.
public abstract void followRedirect ()
Follows a pending redirect. Must only be called at most once for each invocation of
public abstract void getStatus (UrlRequest.StatusListener listener)
public abstract boolean isDone ()
true if the request was successfully started and is now finished (completed,
canceled, or failed).
trueif the request was successfully started and is now finished (completed, canceled, or failed).
public abstract void read (ByteBuffer buffer)
Attempts to read part of the response body into the provided buffer. Must only be called at
most once in response to each invocation of the
onReadCompleted() methods of the
UrlRequest.Callback. Each call will result in an asynchronous call to either the
onReadCompleted() method if data is read, its
onSucceeded() method if there's no more data to read, or its
onFailed() method if there's an error.