apache cxf

633 查看

java
public void testRest_GetScenicListByFilter() throws UnsupportedEncodingException { Filter filter = new Filter(); filter.setCityCode("029"); filter.setDistanceFilter(10); String jsonString = JSON.toJSONString(filter); HttpResponse send = HttpRequest .post("http://192.168.1.111:8080/travelman/rest/scenic/list/0").contentType("application/json","UTF-8").body(jsonString) .send(); System.out.println(send.bodyText()); }

jodd发送content-type为application/json的请求。
不能用form来传递