JSONRequest extends Request<JSONRequest> { public JSONRequest setData(String data) { if (!dataMap.isEmpty()) { throw new IllegalStateException("You cannot use setData in combination with addField"); } if (data == null) { throw new IllegalArgumentException("data cannot be null"); } contents.writeBytes(Unpooled.wrappedBuffer(data.getBytes(UTF8))); return this; } JSONRequest(HttpRequestBuilder builder, EventLoopGroup group, URI uri, HttpVersion version, Reader f,
                       HttpMethod method); FutureResponse execute(Function1<Bootstrap> conf); JSONRequest addField(String name, Object value); JSONRequest setData(String data); JSONRequest setData(Object data); ObjectMapper mapper();  }
@Test public void setContentUsingSetDataStr() { HttpRequestBuilder.instance().postJSON(uri, reader) .setData("{}"); }
@Test public void setContentUsingSetDataObj() throws JsonProcessingException { HttpRequestBuilder.instance().postJSON(uri, reader) .setData(map); }