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;

}

posted @ 2019-03-12 21:34  ZXJ~佳  阅读(1096)  评论(0编辑  收藏  举报