package com.thebuerkle.dropwizard.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.thebuerkle.dropwizard.core.Car;

@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public class TestResource {

    private static final Logger log = LoggerFactory.getLogger(TestResource.class);

    private final Client _client;

    public TestResource(Client client) {
        _client = client;
    }

    @Path("/produce")
    @GET
    public Car produce() {
        return new Car("Elantra", "gray");
    }

    @Path("/consume")
    @GET
    public void consume() {
        WebTarget target = _client.target("http://localhost:8080/produce");
        Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
        Response response = invocation.get();

        log.info(response.readEntity(Car.class).toString());
    }
}

@@ -117,16 +117,47 @@
 oduces;%0A
+import javax.ws.rs.QueryParam;%0A
 import j
@@ -863,20 +863,58 @@
 consume(
+@QueryParam(%22string%22) boolean asString
 ) %7B%0A
-
         
@@ -1129,16 +1129,264 @@
 og.info(
+%22Status code: %22 + Response.Status.fromStatusCode(response.getStatus()));%0A%0A        if (asString) %7B%0A            log.info(%22Response as string: %22 + response.readEntity(String.class));%0A        %7D%0A        else %7B%0A            log.info(%22Response as car: %22 + 
 response
@@ -1417,20 +1417,30 @@
 oString());%0A
+        %7D%0A
     %7D%0A%7D%0A

Add getting response as a string