Example usage for Java io.vertx.core.http HttpServerResponse fields, constructors, methods, implement or subclass
The text is from its open source code.
HttpServerResponse | bodyEndHandler(@Nullable Handler Provides a handler that will be called after the last part of the body is written to the wire. |
long | bytesWritten() |
void | close() Close the underlying TCP connection corresponding to the request. |
HttpServerResponse | closeHandler(@Nullable Handler Set a close handler for the response, this is called when the underlying connection is closed and the response was still using the connection. |
Future | end(String chunk) Same as #end(Buffer) but writes a String in UTF-8 encoding before ending the response. |
Future | end(Buffer chunk) Same as #end() but writes some data to the response body before ending. |
Future | end() Ends the response. |
void | end(String chunk, Handler Same as #end(String) but with an handler called when the operation completes |
Future | end(String chunk, String enc) Same as #end(Buffer) but writes a String with the specified encoding before ending the response. |
void | end(Buffer chunk, Handler Same as #end(Buffer) but with an handler called when the operation completes |
boolean | ended() |
HttpServerResponse | exceptionHandler(Handler |
int | getStatusCode() |
String | getStatusMessage() |
MultiMap | headers() |
boolean | headWritten() |
Future | push(HttpMethod method, String host, String path) Same as #push(HttpMethod,String,String,Handler) but with an handler called when the operation completes |
Future | push(HttpMethod method, String path, MultiMap headers) Same as #push(HttpMethod,String,MultiMap,Handler) but with an handler called when the operation completes |
HttpServerResponse | push(HttpMethod method, String path, Handler Like #push(HttpMethod,String,String,MultiMap,Handler) with the host copied from the current request. |
HttpServerResponse | putHeader(String name, String value) Put an HTTP header |
HttpServerResponse | putHeader(CharSequence name, CharSequence value) Like #putHeader(String,String) but using CharSequence |
HttpServerResponse | putHeader(String name, Iterable Like #putHeader(String,String) but providing multiple values via a String Iterable |
HttpServerResponse | putHeader(CharSequence name, Iterable Like #putHeader(String,Iterable) but with CharSequence Iterable |
HttpServerResponse | putTrailer(String name, String value) Put an HTTP trailer |
HttpServerResponse | putTrailer(CharSequence name, CharSequence value) Like #putTrailer(String,String) but using CharSequence |
HttpServerResponse | putTrailer(String name, Iterable Like #putTrailer(String,String) but providing multiple values via a String Iterable |
HttpServerResponse | putTrailer(CharSequence name, Iterable Like #putTrailer(String,Iterable) but with CharSequence Iterable |
Future | sendFile(String filename, long offset) Same as #sendFile(String,long,long) using length @code{Long.MAX_VALUE} which means until the end of the file. |
HttpServerResponse | sendFile(String filename, Handler Like #sendFile(String) but providing a handler which will be notified once the file has been completely written to the wire. |
Future | sendFile(String filename) Same as #sendFile(String,long) using offset @code{0} which means starting from the beginning of the file. |
HttpServerResponse | setChunked(boolean chunked) If chunked is true , this response will use HTTP chunked encoding, and each call to write to the body will correspond to a new HTTP chunk sent on the wire. |
HttpServerResponse | setStatusCode(int statusCode) Set the status code. |
HttpServerResponse | setStatusMessage(String statusMessage) Set the status message |
MultiMap | trailers() |
Future | write(String chunk) Write a String to the response body, encoded in UTF-8. |
Future | write(String chunk, String enc) Write a String to the response body, encoded using the encoding enc . |
void | write(String chunk, Handler Same as #write(String) but with an handler called when the operation completes |
HttpServerResponse | writeContinue() Used to write an interim 100 Continue response to signify that the client should send the rest of the request. |
HttpServerResponse | writeCustomFrame(int type, int flags, Buffer payload) Write an HTTP/2 frame to the response, allowing to extend the HTTP/2 protocol. The frame is sent immediatly and is not subject to flow control. |