调用实例如:http://192.168.200.244/NM/ProductList.jsp ?Req=
小白求解..
哥们! 你是不是没写全问题?
用httpclient
public void doGet(String url) throws Exception {
String content = null;
try {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(url));
HttpResponse response = client.execute(request);
//返回的流
InputStream in = response.getEntity().getContent();
//解析xml
//用sax、dom4j。。。都可以
} finally {
}
}
参数里面可以有特殊符号"<"、">"么?如果是普通的http请求,推荐使用Spring自带的RestTemplate进行访问。这个用起来方便。http://blog.csdn.net/dyllove98/article/details/41284675
请求与应答的实际参数不能有特殊符号,关键是请求的url不懂怎么弄
可以参考这篇文章,进行xml参数的HTTP请求。http://www.cnblogs.com/azhqiang/p/3782379.html