1. @Get(value = "/http-response", produces = MediaType.TEXT_PLAIN)
    2. HttpResponse httpResponse() {
    3. HttpResponse.status(HttpStatus.CREATED).body("success")
    4. }
    1. @Get(value = "/http-response", produces = [MediaType.TEXT_PLAIN])
    2. fun httpResponse(): HttpResponse<String> {
    3. return HttpResponse.status<String>(HttpStatus.CREATED).body("success")
    4. }
    1. @Get(produces = MediaType.TEXT_PLAIN)
    2. String index() {
    3. return "success"
    4. }
    1. @Status(HttpStatus.CREATED)
    2. @Get(produces = [MediaType.TEXT_PLAIN])
    3. fun index(): String {
    4. return "success"
    1. @Get("/http-status")
    2. HttpStatus httpStatus() {
    3. HttpStatus.CREATED
    4. }
    1. @Get("/http-status")
    2. fun httpStatus(): HttpStatus {
    3. return HttpStatus.CREATED
    4. }