- All Known Implementing Classes:
DefaultHttpServerResponse
,GrizzlyHttpServerResponse
,JdkHttpResponse
,NettyHttpServerResponse
,UndertowHttpResponse
public interface HttpServerResponse
THe HttpServerResponse API.
This API delivers an abstraction over the HTTP response status line, the HTTP response headers and the HTTP response body.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the header.default void
Close the response.Get the header.Returns the output stream.void
Set the specified header.void
setStatus
(int status) Set the status.void
Write the headers.void
Write the status line.
-
Method Details
-
addHeader
Add the header.- Parameters:
name
- the name.value
- the value.
-
closeResponse
Close the response.- Throws:
IOException
- when an I/O error occurs.
-
getHeader
Get the header.- Parameters:
name
- the name.- Returns:
- the value, or null if not found.
-
getOutputStream
OutputStream getOutputStream()Returns the output stream.- Returns:
- the output stream
-
setHeader
Set the specified header.- Parameters:
name
- the header name.value
- the header value.
-
setStatus
void setStatus(int status) Set the status.- Parameters:
status
- the status.
-
writeHeaders
Write the headers.- Throws:
IOException
- when an I/O error occurs.
-
writeStatusLine
Write the status line.- Throws:
IOException
- when an I/O error occurs.
-