Class HttpExchangeAdapter.Response
Object
Response
- All Implemented Interfaces:
PrometheusHttpResponse
- Enclosing class:
- HttpExchangeAdapter
This inner class adapts a HttpServletResponse to a PrometheusHttpResponse.
-
Constructor Summary
ConstructorDescriptionResponse
(HttpServletResponse response) Constructs a new Response with the given HttpServletResponse. -
Method Summary
Modifier and TypeMethodDescriptionsendHeadersAndGetBody
(int statusCode, int contentLength) This is equivalent to callingHttpExchange.sendResponseHeaders(int, long)
followed byHttpExchange.getResponseBody()
.void
Seejakarta.servlet.http.HttpServletResponse.setHeader(String, String)
-
Constructor Details
-
Response
Constructs a new Response with the given HttpServletResponse.- Parameters:
response
- the HttpServletResponse to be adapted
-
-
Method Details
-
setHeader
Description copied from interface:PrometheusHttpResponse
Seejakarta.servlet.http.HttpServletResponse.setHeader(String, String)
- Specified by:
setHeader
in interfacePrometheusHttpResponse
-
sendHeadersAndGetBody
Description copied from interface:PrometheusHttpResponse
This is equivalent to callingHttpExchange.sendResponseHeaders(int, long)
followed byHttpExchange.getResponseBody()
.- Specified by:
sendHeadersAndGetBody
in interfacePrometheusHttpResponse
- Throws:
IOException
-