Interface HttpClientResponse
-
public interface HttpClientResponseRepresentation of an HTTP response.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOCATIONstatic java.lang.StringSET_COOKIE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<java.io.InputStream>getBody()Returns anOptionalinput stream for the response body.java.util.Optional<java.lang.String>getContentType()Return the content-type header value.default java.util.List<java.net.HttpCookie>getCookies()Get the parsed cookies from the "Set-Cookie" headerHttpClientHeadersgetHeaders()Return aListof theHttpClientHeadersresponse header value.default java.util.Optional<java.lang.String>getLocation()Location header value sent for redirects.default java.util.Optional<ObjectMetadataValue>getMetadata()Get the metadata related to the HTTP request sent.intgetStatus()Returns the status code for the request.java.util.Optional<java.lang.String>getStatusText()Returns the status text for the request.
-
-
-
Field Detail
-
LOCATION
static final java.lang.String LOCATION
- See Also:
- Constant Field Values
-
SET_COOKIE
static final java.lang.String SET_COOKIE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStatus
int getStatus()
Returns the status code for the request.- Returns:
- The status code
-
getStatusText
java.util.Optional<java.lang.String> getStatusText()
Returns the status text for the request.- Returns:
- The status text
-
getHeaders
HttpClientHeaders getHeaders()
Return aListof theHttpClientHeadersresponse header value.- Returns:
- the
Listof theHttpClientHeaders
-
getContentType
java.util.Optional<java.lang.String> getContentType()
Return the content-type header value.- Returns:
- the content-type header value.
-
getBody
java.util.Optional<java.io.InputStream> getBody()
Returns anOptionalinput stream for the response body. Note that you should not try to get this more than once, and that you should not close the stream.- Returns:
- The
Optionalinput stream
-
getLocation
default java.util.Optional<java.lang.String> getLocation()
Location header value sent for redirects. By default, this library will not follow redirects- Returns:
- the location header value
-
getCookies
default java.util.List<java.net.HttpCookie> getCookies()
Get the parsed cookies from the "Set-Cookie" header- Returns:
- the
Listof theHttpCookie
-
getMetadata
default java.util.Optional<ObjectMetadataValue> getMetadata()
Get the metadata related to the HTTP request sent. (Useful to populate HTTP request metrics)- Returns:
- the metadata.
-
-