String url = "http://IP:PORT/abc";
HttpClient client = new HttpClient();
String params = "SPNUM=1062106280&MOBILE=15906563170&CONTENT=123" ;
HttpMethod method = new GetMethod(url);
method.setQueryString(params);
client.executeMethod(method);
if (method.getStatusCode() == HttpStatus.SC_OK) {
String response = method.getResponseBodyAsString();
System.out.println(response);
}
method.releaseConnection();
httpclient get 例子
最新推荐文章于 2024-04-19 17:02:12 发布