java之接口开发-初级篇-http和https
http协议util
address(url地址),str(数据参数)
private static HttpMethod getPostJsonMethodInRequestBody(String address, String str) {
PostMethod post = new PostMethod(address);
post.addRequestHeader("Content-Type", "application/json; charset=utf-8");
post.setRequestBody(str);
return post;
}