-
public class Call<ResponseBody extends Object>A single, one-shot HTTP call: one Request paired with the ResponseConverter that turns the raw response body into a typed ResponseBody. Produced by
ApiCallFactory(never constructed by application code) and handed to a Task, which runs it via execute.A call is single-use: the second execute on the same instance throws IllegalStateException. The raw body is run through converter; a JSON parse failure is surfaced as a ParsingException.
-
-
Constructor Summary
Constructors Constructor Description Call(Request request, HttpClient httpClient, ResponseConverter<ResponseBody> converter)
-
Method Summary
Modifier and Type Method Description final RequestoriginalRequest()Response<ResponseBody>execute()Executes this call synchronously on the calling thread and returns the parsed Response. -
-
Constructor Detail
-
Call
Call(Request request, HttpClient httpClient, ResponseConverter<ResponseBody> converter)
- Parameters:
request- the request to perform.httpClient- transport that actually performs the request.converter- transforms the raw response body into ResponseBody.
-
-
Method Detail
-
originalRequest
final Request originalRequest()
-
execute
Response<ResponseBody> execute()
Executes this call synchronously on the calling thread and returns the parsed Response.
-
-
-
-