Java Code Examples for io.micronaut.http.MediaType#TEXT_PLAIN
The following examples show how to use
io.micronaut.http.MediaType#TEXT_PLAIN .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MathController.java From micronaut-test with Apache License 2.0 | 4 votes |
@Get(uri = "/compute/{number}", processes = MediaType.TEXT_PLAIN) String compute(Integer number) { return String.valueOf(mathService.compute(number)); }
Example 2
Source File: HelloController.java From java-docs-samples with Apache License 2.0 | 4 votes |
@Get("/") @Produces(MediaType.TEXT_PLAIN) public String index() { return "Hello World!"; }
Example 3
Source File: PlainText.java From FrameworkBenchmarks with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Get(value = "/", produces = MediaType.TEXT_PLAIN) Single<String> getPlainText() { return Single.just(TEXT); }
Example 4
Source File: GreetController.java From tutorials with MIT License | 4 votes |
@Post(value = "/{name}", consumes = MediaType.TEXT_PLAIN) public String setGreeting(@Body String name) { return greetingService.getGreeting() + name; }