WebClient client = WebClient.create(address);
WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(10000000);
client.type("multipart/form-data").accept("text/plain");
List<Attachment> atts = new LinkedList<Attachment>();
atts.add(new Attachment("somepart", "text/plain", "hello there"));
Response r = client.postCollection(atts, Attachment.class);
assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
assertEquals("nobody home", IOUtils.readStringFromStream((InputStream)r.getEntity()));
}
@Test