public static void main(String[] args) throws HttpException, IOException {
HttpClient httpClient = new HttpClient();
PostMethod getMethod = new PostMethod(
"http://localhost:7070/notification.do?action=send");
getMethod.setParameter("title", "abc");
getMethod.setParameter("message", "2222");
getMethod.setParameter("username", "");
getMethod.setParameter("uri", "");
httpClient.executeMethod(getMethod);
System.out.println(getMethod.getResponseBodyAsString());
}
Httpclient发送POST请求
最新推荐文章于 2024-03-18 15:51:31 发布