messageImpl.put(Message.REQUEST_URI, "/foo");
messageImpl.put("Content-Type", MediaType.APPLICATION_FORM_URLENCODED);
messageImpl.setContent(InputStream.class, new ByteArrayInputStream(body.getBytes()));
ProviderFactory.getInstance(messageImpl).registerUserProvider(
new FormEncodingProvider() {
@Override
protected void persistParamsOnMessage(MultivaluedMap<String, String> params) {
messageImpl.put(FormUtils.FORM_PARAM_MAP, params);
}
});