WebResource wr = znodesr.path(path).queryParam("dataformat", encoding);
if (data == null) {
wr = wr.queryParam("null", "true");
}
Builder builder = wr.accept(accept)
.type(MediaType.APPLICATION_OCTET_STREAM);
ClientResponse cr;
if (data == null) {
cr = builder.put(ClientResponse.class);
} else {
// this shouldn't be necessary (wrapping data with string)
// but without it there are problems on the server - ie it
// hangs for 30 seconds and doesn't get the data.
// TODO investigate
cr = builder.put(ClientResponse.class, new String(data));
}
assertEquals(expectedStatus, cr.getClientResponseStatus());
if (expectedStat == null) {
return;