Class HttpResponse

java.lang.Object
com.intellectualsites.http.HttpResponse

public final class HttpResponse extends Object
A HTTP response
  • Method Details

    • getStatus

      @NotNull public @NotNull String getStatus()
      Get the HTTP status message
      Returns:
      Status message
    • getStatusCode

      public int getStatusCode()
      Get the HTTP status code
      Returns:
      Status code
    • getRawResponse

      @NotNull public @org.jetbrains.annotations.NotNull byte[] getRawResponse()
      Get the raw response body
      Returns:
      Response body
    • getHeaders

      @NotNull public @NotNull com.intellectualsites.http.Headers getHeaders()
      Get the response headers
      Returns:
      Response headers
    • getResponseEntity

      @NotNull public <T> T getResponseEntity(@NotNull @NotNull Class<T> returnType)
      Get the response entity and map it to a specific type
      Type Parameters:
      T - Return type
      Parameters:
      returnType - Return type class
      Returns:
      Response
      Throws:
      IllegalArgumentException - If no mapper exists for the type