vertx / io.vertx.rxjava.core.http / HttpServerResponse / end

# end

`open fun end(chunk: String): Unit`

Same as `io.vertx.rxjava.core.http.HttpServerResponse#end` but writes a String in UTF-8 encoding before ending the response.

### Parameters

`chunk` - the string to write before ending the response

`open fun end(chunk: String, enc: String): Unit`

Same as `io.vertx.rxjava.core.http.HttpServerResponse#end` but writes a String with the specified encoding before ending the response.

### Parameters

`chunk` - the string to write before ending the response

`enc` - the encoding to use

`open fun end(chunk: Buffer): Unit`

Same as `io.vertx.rxjava.core.http.HttpServerResponse#end` but writes some data to the response body before ending. If the response is not chunked and no other data has been written then the @code{Content-Length} header will be automatically set.

### Parameters

`chunk` - the buffer to write before ending the response

`open fun end(): Unit`

Ends the response. If no data has been written to the response body, the actual response won't get written until this method gets called.

Once the response has ended, it cannot be used any more.