Package io.micronaut.servlet.http
Interface ServletExchange<Req,Res>
- Type Parameters:
Req
- The native request typeRes
- The native response type
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ApacheServletHttpRequest
,DefaultServletExchange
,DefaultServletHttpRequest
,PojaHttpRequest
Represents an HTTP exchange in a serverless context.
- Since:
- 2.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
default @NonNull ServletHttpResponse<Res,
?> Create a new, empty response for this exchange.ServletHttpRequest<Req,
? super Object> @NonNull ServletHttpResponse<Res,
?> Get the current response, the last response created bycreateResponse()
.
-
Method Details
-
getRequest
ServletHttpRequest<Req,? super Object> getRequest()- Returns:
- The request object
-
getResponse
Get the current response, the last response created bycreateResponse()
.- Returns:
- The response object
-
createResponse
Create a new, empty response for this exchange. Only the last response created for a request is fully backed by the servlet container response, meaning it can accessServletHttpResponse.getOutputStream()
and similar methods.- Returns:
- The response
- Since:
- 5.1.0
-
close
default void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-