Class UiApiStreamResponse
java.lang.Object
com.kingsrook.qqq.middleware.javalin.specs.invoke.UiApiStreamResponse
- All Implemented Interfaces:
AutoCloseable
A streaming UI API response. Close after consuming the body, including errors.
-
Constructor Summary
ConstructorsConstructorDescriptionUiApiStreamResponse(int status, Map<String, List<String>> headers, InputStream inputStream) Construct a response owning the supplied body stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release the response stream and its connection resources.First header value, matched without regard to case; null when absent.Getter for headers.Getter for the caller-owned response stream.intGetter for status.booleanWhether the HTTP status is successful.Consume the remaining body as UTF-8, useful for error responses.
-
Constructor Details
-
UiApiStreamResponse
Construct a response owning the supplied body stream.
-
-
Method Details
-
getStatus
public int getStatus()Getter for status. -
getHeaders
-
getHeader
-
getInputStream
Getter for the caller-owned response stream. -
isSuccess
public boolean isSuccess()Whether the HTTP status is successful. -
readBodyAsString
Consume the remaining body as UTF-8, useful for error responses.- Throws:
IOException
-
close
Release the response stream and its connection resources.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-