Class HttpResponse

java.lang.Object
com.luciad.net.http.HttpResponse
All Implemented Interfaces:
AutoCloseable

public final class HttpResponse extends Object implements AutoCloseable
An HTTP response.

An HttpResponse instance is built through an HttpResponse.Builder.

This class provides methods for accessing the response status code, headers and the response body.

Since:
2023.0
  • Constructor Details

    • HttpResponse

      public HttpResponse(@NotNull HttpResponse other)
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • newBuilder

      @NotNull public static HttpResponse.Builder newBuilder()
      Returns the new HttpResponse builder.
      Returns:
      the new HttpResponse builder.
    • getBody

      @Nullable public DataEntity getBody()
      Returns the body of this response.
      Returns:
      the body of this response.
    • getHeaders

      @NotNull public List<@NotNull HttpHeader> getHeaders()
      Returns the received response headers.
      Returns:
      the received response headers.
    • getStatusCode

      public int getStatusCode()
      Returns the status code for this response.
      Returns:
      the status code for this response.