Class HankoHttpResponse

java.lang.Object
io.hanko.sdk.http.HankoHttpResponse

public class HankoHttpResponse extends Object
Encapsulates a Hanko API response.
  • Constructor Details

    • HankoHttpResponse

      public HankoHttpResponse(InputStream stream, int statusCode, String requestPath)
      Create a HankoHttpResponse.
      Parameters:
      stream - input stream
      statusCode - status code
      requestPath - the original request path
  • Method Details

    • getStream

      public InputStream getStream()
      Get the response content as an InputStream.
      Returns:
      the response content as an InputStream
    • getContent

      public String getContent()
      Get the response content as String.
      Returns:
      The response content as a String
    • getStatusCode

      public int getStatusCode()
      Get the HTTP status code of the response.
      Returns:
      the HTTP status code as an int
    • getRequestPath

      public String getRequestPath()
      Get the original request path for the related request.
      Returns:
      the request path as a String
    • success

      public boolean success()
      Check whether the response indicates a successful request, i.e.: whether the response status code is in the 2xx range.
      Returns:
      true if the request was successful, false otherwise