Interface HttpClientResponse


public interface HttpClientResponse
Representation of an HTTP response.
  • Field Details

  • Method Details

    • getStatus

      int getStatus()
      Returns the status code for the request.
      Returns:
      The status code
    • getStatusText

      Optional<String> getStatusText()
      Returns the status text for the request.
      Returns:
      The status text
    • getHeaders

      HttpClientHeaders getHeaders()
      Return a List of the HttpClientHeaders response header value.
      Returns:
      the List of the HttpClientHeaders
    • getContentType

      Optional<String> getContentType()
      Return the content-type header value.
      Returns:
      the content-type header value.
    • getBody

      Optional<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 Optional<String> getLocation()
      Location header value sent for redirects. By default, this library will not follow redirects
      Returns:
      the location header value
    • getCookies

      default List<HttpCookie> getCookies()
      Get the parsed cookies from the "Set-Cookie" header
      Returns:
      the List of the HttpCookie
    • getMetadata

      default Optional<ObjectMetadataValue> getMetadata()
      Get the metadata related to the HTTP request sent. (Useful to populate HTTP request metrics)
      Returns:
      the metadata.