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

# end

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

Same as `#end(Buffer)` but writes a String in UTF-8 encoding before ending the response.

### Parameters

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

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

Same as `#end(Buffer)` 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

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

Same as `#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

`abstract 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.