001package io.prometheus.metrics.exporter.common; 002 003import java.io.IOException; 004import java.io.OutputStream; 005 006public interface PrometheusHttpResponse { 007 008 /** See {@code jakarta.servlet.http.HttpServletResponse.setHeader(String, String)} */ 009 void setHeader(String name, String value); 010 011 /** 012 * This is equivalent to calling {@link 013 * com.sun.net.httpserver.HttpExchange#sendResponseHeaders(int, long)} followed by {@link 014 * com.sun.net.httpserver.HttpExchange#getResponseBody()}. 015 */ 016 OutputStream sendHeadersAndGetBody(int statusCode, int contentLength) throws IOException; 017}