N
- The native response typeB
- The body typepublic interface ServletHttpResponse<N,B>
extends io.micronaut.http.MutableHttpResponse<B>
Modifier and Type | Method and Description |
---|---|
N |
getNativeResponse() |
java.io.OutputStream |
getOutputStream()
Returns an
OutputStream that can be used to write the body of the response. |
java.io.BufferedWriter |
getWriter()
Returns a
BufferedWriter that can be used to write the text body of the response. |
default org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> |
stream(org.reactivestreams.Publisher<?> dataPublisher)
Streams data using the given data publisher.
|
attribute, body, characterEncoding, characterEncoding, contentEncoding, contentLength, contentType, contentType, cookie, cookies, header, headers, headers, locale, status, status, status, status
accepted, accepted, badRequest, badRequest, body, code, created, created, created, getCookie, getCookies, getStatus, header, noContent, notAllowed, notAllowed, notAllowedGeneric, notFound, notFound, notModified, ok, ok, permanentRedirect, reason, redirect, seeOther, serverError, serverError, setAttribute, status, status, status, temporaryRedirect, unauthorized, unprocessableEntity, uri
basicAuth, bearerAuth, getHeaders
N getNativeResponse()
java.io.OutputStream getOutputStream() throws java.io.IOException
OutputStream
that can be used to write the body of the response.
This method is typically used to write binary data. If the body is text, the
getWriter()
method is more appropriate.java.io.IOException
- if a valid OutputStream
cannot be returned for some reason.java.lang.IllegalStateException
- if getWriter()
has already been called on this instance.java.io.BufferedWriter getWriter() throws java.io.IOException
BufferedWriter
that can be used to write the text body of the response.
If the written text will not be US-ASCII, you should specify a character encoding by calling
MutableHttpResponse.contentEncoding(CharSequence)
before calling this method.java.io.IOException
- if a valid BufferedWriter
cannot be returned for some reason.java.lang.IllegalStateException
- if getOutputStream()
has already been called on this
instance.default org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> stream(org.reactivestreams.Publisher<?> dataPublisher)
dataPublisher
- The data publisher