Package io.hanko.sdk.http
Class HankoHttpResponse
java.lang.Object
io.hanko.sdk.http.HankoHttpResponse
Encapsulates a Hanko API response.
-
Constructor Summary
ConstructorsConstructorDescriptionHankoHttpResponse(InputStream stream, int statusCode, String requestPath)
Create a HankoHttpResponse. -
Method Summary
Modifier and TypeMethodDescriptionGet the response content as String.Get the original request path for the related request.int
Get the HTTP status code of the response.Get the response content as an InputStream.boolean
success()
Check whether the response indicates a successful request, i.e.: whether the response status code is in the 2xx range.
-
Constructor Details
-
HankoHttpResponse
Create a HankoHttpResponse.- Parameters:
stream
- input streamstatusCode
- status coderequestPath
- the original request path
-
-
Method Details
-
getStream
Get the response content as an InputStream.- Returns:
- the response content as an InputStream
-
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
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
-