Interface HttpBaseResponse
- All Superinterfaces:
BaseResponse
- All Known Subinterfaces:
GenericResponse,HttpMessageResponse,HttpPlainResponse,HttpResponse,HttpResponse,MessageResponse,Response,TcpResponse
Base interface for all http-based responses.
Defines the common information that can be accessed for any http-based responses.
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanended()Indicates if the response is ended or not.headers()default booleanIndicates if response has status in 100-199 range.default booleanIndicates if response has status in 200-299 range.default booleanIndicates if response has status in 300-399 range.default booleanIndicates if response has status in 400-499 range.default booleanIndicates if response has status in 500-599 range.reason()Set the reason message.intstatus()Return the current http status.status(int statusCode) Set the status code of the http response.trailers()
-
Method Details
-
status
Set the status code of the http response.- Parameters:
statusCode- the status code to set.- Returns:
- a self-reference.
-
status
int status()Return the current http status.- Returns:
- the current status code.
-
reason
String reason()- Returns:
- Reason-Phrase is intended to give a short textual description of the Status-Code.
-
reason
Set the reason message.- Parameters:
message- the message to set as a reason.- Returns:
- a self-reference.
-
headers
HttpHeaders headers()- Returns:
- the headers in the response.
-
trailers
HttpHeaders trailers()- Returns:
- the trailers in the response (http/2).
-
ended
boolean ended()Indicates if the response is ended or not. Ended response means the response has been fully push to the client, including response body.- Returns:
trueif the response has been fully pushed to the client,falseelse.
-
isStatus1xx
default boolean isStatus1xx()Indicates if response has status in 100-199 range.- Returns:
- true if status is 1xx
-
isStatus2xx
default boolean isStatus2xx()Indicates if response has status in 200-299 range.- Returns:
- true if status is 2xx
-
isStatus3xx
default boolean isStatus3xx()Indicates if response has status in 300-399 range.- Returns:
- true if status is 3xx
-
isStatus4xx
default boolean isStatus4xx()Indicates if response has status in 400-499 range.- Returns:
- true if status is 4xx
-
isStatus5xx
default boolean isStatus5xx()Indicates if response has status in 500-599 range.- Returns:
- true if status is 5xx
-