From caed7894bb8af46e50832cef0ff1a331dc68a27b Mon Sep 17 00:00:00 2001 From: joshua bauer Date: Wed, 10 May 2017 17:43:15 -0700 Subject: [PATCH] Updates to README. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c812259..e87ac9b 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,10 @@ A great deal of inspiration came from working with the following excellent proje - For methods that should return a String or ByteBuffer to the client users can create responses like this: ```java @GET - @Path("/echo") + @Path("/plaintext2") @Produces((MediaType.TEXT_PLAIN)) - @ApiOperation(value = "Echo a message", httpMethod = "GET" ) - public io.sinistral.proteus.server.ServerResponse plaintext(String message) + @ApiOperation(value = "Serve a plaintext message using a ServerResponse", httpMethod = "GET" ) + public io.sinistral.proteus.server.ServerResponse plaintext2(String message) { return io.sinistral.proteus.server.ServerResponse.response("Hello, World!").contentType(PLAINTEXT_TYPE); } @@ -100,13 +100,13 @@ A great deal of inspiration came from working with the following excellent proje return io.sinistral.proteus.server.ServerResponse.response(new World(id,randomNumber)); } ``` -- The entity can be set separately as well: +- The entity can be set separately as well (however, this removes the type checking): ```java @GET @Path("/world") @Produces((MediaType.APPLICATION_JSON)) @ApiOperation(value = "Return a world JSON object", httpMethod = "GET", response=World.class ) - public io.sinistral.proteus.server.ServerResponse getWorld(Integer id, Integer randomNumber ) + public io.sinistral.proteus.server.ServerResponse getWorld(Integer id, Integer randomNumber ) { return io.sinistral.proteus.server.ServerResponse.response().entity(new World(id,randomNumber)); }