- Type Parameters:
T
- type of the response
public interface ClientResponseTyped<T>
Http client response explicitly typed.
The typed entity does not extend
AutoCloseable
, as in most cases the entity is fully read into memory.
Kindly make sure that you fully consume the entity in cases where it cannot be buffered (depends on media support used).-
Method Details
-
entity
T entity()Entity of the requested type.- Returns:
- entity
-
close
void close()Closes the response. This may have no impact on the underlying connection. Response is implicitly closed if the entity is fully read. -
status
Status status()Response status.- Returns:
- status
-
headers
ClientResponseHeaders headers()Response headers.- Returns:
- headers
-
trailers
ClientResponseTrailers trailers()Response trailer headers. Blocks until trailers are available.- Returns:
- trailers
- Throws:
IllegalStateException
- when invoked before entity is requested
-
lastEndpointUri
ClientUri lastEndpointUri()URI of the last request. (after redirection)- Returns:
- last URI
-