@Test public void body() { Request request = new RequestBuilderImpl() .body(new JsonObject().put("name", "value")) .build(); assertEquals("value", request.body().asJson().toBlocking().last().get("name").asString()); assertEquals("value", new JsonObject(request.body().asString().toBlocking().last()).get("name").asString()); assertEquals("value", new JsonObject(new String(request.body().asBytes().toBlocking().last())).get("name").asString()); assertEquals("value", new JsonObject(new String(request.body().asChunks() .collect( () -> new ByteArrayOutputStream(), (stream, chunk) -> { try { stream.write(chunk); } catch (IOException e) { } }) .map(stream -> stream.toByteArray()) .toBlocking().last())).get("name").asString()); request = new RequestBuilderImpl() .body(new JsonArray("[{\"name\" : \"value\"}]")) .build(); assertEquals("value", request.body().asJsonArray().toBlocking().last().get("name").asString()); }
@Override public RequestBuilder body(Body body) { this.body = body; return this; }
RequestBuilderImpl implements RequestBuilder { @Override public RequestBuilder body(Body body) { this.body = body; return this; } }
RequestBuilderImpl implements RequestBuilder { @Override public RequestBuilder body(Body body) { this.body = body; return this; }  }
RequestBuilderImpl implements RequestBuilder { @Override public RequestBuilder body(Body body) { this.body = body; return this; }  @Override Request build(); @Override RequestBuilder connectTimeout(int milliseconds); @Override RequestBuilder body(Body body); @Override RequestBuilder body(Value entity); @Override RequestBuilder header(RequestHeader header, String value); @Override RequestBuilder header(String name, String value); @Override RequestBuilder method(Method method); @Override RequestBuilder method(String method); @Override RequestBuilder queryParameter(String name, String value); @Override RequestBuilder uri(String uri); @Override RequestBuilder uriParameter(String name, T value); }
RequestBuilderImpl implements RequestBuilder { @Override public RequestBuilder body(Body body) { this.body = body; return this; }  @Override Request build(); @Override RequestBuilder connectTimeout(int milliseconds); @Override RequestBuilder body(Body body); @Override RequestBuilder body(Value entity); @Override RequestBuilder header(RequestHeader header, String value); @Override RequestBuilder header(String name, String value); @Override RequestBuilder method(Method method); @Override RequestBuilder method(String method); @Override RequestBuilder queryParameter(String name, String value); @Override RequestBuilder uri(String uri); @Override RequestBuilder uriParameter(String name, T value);  }