MCPcopy
hub / github.com/square/retrofit / Call

Interface Call

retrofit/src/main/java/retrofit2/Call.java:35–81  ·  view source on GitHub ↗

An invocation of a Retrofit method that sends a request to a webserver and returns a response. Each call yields its own HTTP request and response pair. Use #clone to make multiple calls with the same parameters to the same webserver; this may be used to implement polling or to retry a failed

Source from the content-addressed store, hash-verified

33 * @param <T> Successful response body type.
34 */
35public interface Call<T> extends Cloneable {
36 /**
37 * Synchronously send the request and return its response.
38 *
39 * @throws IOException if a problem occurred talking to the server.
40 * @throws RuntimeException (and subclasses) if an unexpected error occurs creating the request or
41 * decoding the response.
42 */
43 Response<T> execute() throws IOException;
44
45 /**
46 * Asynchronously send the request and notify {@code callback} of its response or if an error
47 * occurred talking to the server, creating the request, or processing the response.
48 */
49 void enqueue(Callback<T> callback);
50
51 /**
52 * Returns true if this call has been either {@linkplain #execute() executed} or {@linkplain
53 * #enqueue(Callback) enqueued}. It is an error to execute or enqueue a call more than once.
54 */
55 boolean isExecuted();
56
57 /**
58 * Cancel this call. An attempt will be made to cancel in-flight calls, and if the call has not
59 * yet been executed it never will be.
60 */
61 void cancel();
62
63 /** True if {@link #cancel()} was called. */
64 boolean isCanceled();
65
66 /**
67 * Create a new, identical call to this one which can be enqueued or executed even if this call
68 * has already been.
69 */
70 Call<T> clone();
71
72 /** The original HTTP request. */
73 Request request();
74
75 /**
76 * Returns a timeout that spans the entire call: resolving DNS, connecting, writing the request
77 * body, server processing, and reading the response body. If the call requires redirects or
78 * retries all must complete within one timeout period.
79 */
80 Timeout timeout();
81}

Callers 63

anInterfaceMethod · 0.65
anImplementationMethod · 0.65
annotationsMethod · 0.65
asLenientMethod · 0.65
withNullsMethod · 0.65
failOnUnknownMethod · 0.65
utf8BomSkippedMethod · 0.65
anInterfaceMethod · 0.65
anImplementationMethod · 0.65
annotationsMethod · 0.65
asLenientMethod · 0.65

Implementers 6

ExecutorCallbackCallretrofit/src/main/java/retrofit2/Defau
OkHttpCallretrofit/src/main/java/retrofit2/OkHtt
EmptyCallretrofit/java-test/src/test/java/retro
FakeCallretrofit-mock/src/main/java/retrofit2/
DeferredCallretrofit-mock/src/main/java/retrofit2/
BehaviorCallretrofit-mock/src/main/java/retrofit2/

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…