public class JerseyClientUtil { public static<T> T sendMsg(String url,Object object,Class<T> clazz){ ClientConfig config=new DefaultClientConfig(JacksonJsonProvider.class); config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,Boolean.TRUE); Client client=Client.create(config); WebResource resource=client.resource(url); ClientResponse response=resource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).post(ClientResponse.class,object); return response.getEntity(clazz); } }