Defines the method to be invoked when the response is first received.
Defines the method to be invoked when the response is first received.
Gets the time taken from when the request was first sent across the network to when the response was fully received (in the case of a buffered response) or just acquired (in the case of an unbuffered response).
Gets the time taken from when the request was first sent across the network to when the response was fully received (in the case of a buffered response) or just acquired (in the case of an unbuffered response).
Gets the response that was captured earlier.
Gets the response that was captured earlier.
Gets the timer created before the request was first sent across the network.
Gets the timer created before the request was first sent across the network.
Provides a response builder implementation that returns unbuffered responses along with the InputStream that provides data from the origin HTTP server. This input stream *must* be closed by the calling code to avoid connection leakage issues. The stream implementation makes this easier by automatically closing the stream as soon as all the data has been consumed. This is an alternative to explicitly calling the
close()
method on the stream; you can use either method.To make things easier, there are two different cases.
1. For 200 (OK) or 206 (partial content) only, an InputStreamResponseBody is returned, containing the stream ready for use by the calling code, which *must* finally close the stream. As mentioned above, this can either be done by explicitly calling
close()
or by consuming to the end of the stream, which in this case will automatically close the stream.2. For all responses other than 200 (OK) or 206 (partial content), a buffered body is returned in which the stream has already been consumed and closed. Calling
close()
again is harmless but unnecessary.This is not thread safe so a new instance is required for every request.
InputStreamResponseBody