Java io.vertx.core.http HttpServerResponse fields, constructors, methods, implement or subclass

Example usage for Java io.vertx.core.http HttpServerResponse fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for io.vertx.core.http HttpServerResponse.

The text is from its open source code.

Implementation

io.vertx.core.http.HttpServerResponse has the following implementations.
Click this link to see all its implementation.

Method

HttpServerResponsebodyEndHandler(@Nullable Handler handler)
Provides a handler that will be called after the last part of the body is written to the wire.
longbytesWritten()
voidclose()
Close the underlying TCP connection corresponding to the request.
HttpServerResponsecloseHandler(@Nullable Handler 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.
Futureend(String chunk)
Same as #end(Buffer) but writes a String in UTF-8 encoding before ending the response.
Futureend(Buffer chunk)
Same as #end() but writes some data to the response body before ending.
Futureend()
Ends the response.
voidend(String chunk, Handler> handler)
Same as #end(String) but with an handler called when the operation completes
Futureend(String chunk, String enc)
Same as #end(Buffer) but writes a String with the specified encoding before ending the response.
voidend(Buffer chunk, Handler> handler)
Same as #end(Buffer) but with an handler called when the operation completes
booleanended()
HttpServerResponseexceptionHandler(Handler handler)
intgetStatusCode()
StringgetStatusMessage()
MultiMapheaders()
booleanheadWritten()
Futurepush(HttpMethod method, String host, String path)
Same as #push(HttpMethod,String,String,Handler) but with an handler called when the operation completes
Futurepush(HttpMethod method, String path, MultiMap headers)
Same as #push(HttpMethod,String,MultiMap,Handler) but with an handler called when the operation completes
HttpServerResponsepush(HttpMethod method, String path, Handler> handler)
Like #push(HttpMethod,String,String,MultiMap,Handler) with the host copied from the current request.
HttpServerResponseputHeader(String name, String value)
Put an HTTP header
HttpServerResponseputHeader(CharSequence name, CharSequence value)
Like #putHeader(String,String) but using CharSequence
HttpServerResponseputHeader(String name, Iterable values)
Like #putHeader(String,String) but providing multiple values via a String Iterable
HttpServerResponseputHeader(CharSequence name, Iterable values)
Like #putHeader(String,Iterable) but with CharSequence Iterable
HttpServerResponseputTrailer(String name, String value)
Put an HTTP trailer
HttpServerResponseputTrailer(CharSequence name, CharSequence value)
Like #putTrailer(String,String) but using CharSequence
HttpServerResponseputTrailer(String name, Iterable values)
Like #putTrailer(String,String) but providing multiple values via a String Iterable
HttpServerResponseputTrailer(CharSequence name, Iterable value)
Like #putTrailer(String,Iterable) but with CharSequence Iterable
FuturesendFile(String filename, long offset)
Same as #sendFile(String,long,long) using length @code{Long.MAX_VALUE} which means until the end of the file.
HttpServerResponsesendFile(String filename, Handler> resultHandler)
Like #sendFile(String) but providing a handler which will be notified once the file has been completely written to the wire.
FuturesendFile(String filename)
Same as #sendFile(String,long) using offset @code{0} which means starting from the beginning of the file.
HttpServerResponsesetChunked(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.
HttpServerResponsesetStatusCode(int statusCode)
Set the status code.
HttpServerResponsesetStatusMessage(String statusMessage)
Set the status message
MultiMaptrailers()
Futurewrite(String chunk)
Write a String to the response body, encoded in UTF-8.
Futurewrite(String chunk, String enc)
Write a String to the response body, encoded using the encoding enc .
voidwrite(String chunk, Handler> handler)
Same as #write(String) but with an handler called when the operation completes
HttpServerResponsewriteContinue()
Used to write an interim 100 Continue response to signify that the client should send the rest of the request.
HttpServerResponsewriteCustomFrame(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.