Interface HttpClientResponse


  • public interface HttpClientResponse
    Representation of an HTTP response.
    • 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
      • 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 an Optional input 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 Optional input 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 List of the HttpCookie
      • 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.