@Test
public void testPostForm() throws Exception
{
ClientRequest request = new ClientRequest(TEST_URI);
MultipartFormDataOutput mpfdo = new MultipartFormDataOutput();
mpfdo.addFormData("part1", "This is Value 1", MediaType.TEXT_PLAIN_TYPE);
mpfdo.addFormData("part2", "This is Value 2", MediaType.TEXT_PLAIN_TYPE);
mpfdo.addFormData("data.txt", LocateTestData.getTestData("data.txt"), MediaType.TEXT_PLAIN_TYPE);
request.body(MediaType.MULTIPART_FORM_DATA_TYPE, mpfdo);
ClientResponse<InputStream> response = request.post(InputStream.class);
BufferedInputStream in = new BufferedInputStream(response.getEntity());
String contentType = response.getResponseHeaders().getFirst("content-type");
System.out.println(contentType);