Class HttpResponse<T>

java.lang.Object
dev.gmitch215.bytebox.net.http.HttpResponse<T>
Type Parameters:
T - what the body was read as

public final class HttpResponse<T> extends Object
A response, standing in for java.net.http.HttpResponse.
Since:
1.0.0
  • Method Details

    • statusCode

      public int statusCode()
      Returns the status code.
      Returns:
      the status code
    • headers

      public HttpHeaders headers()
      Returns the response headers.
      Returns:
      the response headers
    • body

      public T body()
      Returns the body, read the way the handler asked for.
      Returns:
      the body, read the way the handler asked for
    • request

      public HttpRequest request()
      Returns the request this answers.
      Returns:
      the request this answers
    • uri

      public URI uri()
      Returns the URI the body came from, which differs from the request's after a redirect.
      Returns:
      the URI the body came from, which differs from the request's after a redirect
    • previousResponse

      public Optional<HttpResponse<T>> previousResponse()
      Returns the response that redirected to this one, which is never present: fetch hides them.
      Returns:
      the response that redirected to this one, which is never present: fetch hides them
    • toString

      public String toString()
      Overrides:
      toString in class Object