欢迎来到Heck's Blog,专业承接拿站、企业建站、仿站、网上商城架构、门户网站搭建、空间域名注册、软件定制等项目。关注网络安全,因为专注,所以专业,懂得放弃,才能收获。有事请发邮件至i@heckjj.com,请记住本站网址:http://www.heckjj.com,多谢。
8月5
x-www-form-urlencoded方式:
Map<String,Object> map = new HashMap<>();
map.put("page_size","100")
map.put("ps", "100")
map.put("page_flag", "true")
Document doc = Jsoup.connect("http://www.zgetfl.org/qget/main_qget/sqgl/apLcChildAction.do?method=listApLcChildnew")
.header("useragent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36")
.header("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
.data("page_size","100")
.data("ps", "100")
.data("page_flag", "true")
.post();
application/json方式:
Map<String,String> map = new HashMap<>();
map.put("username","aaaa");
map.put("password","123456");
Gson gson = new Gson();
String parameter = gson.toJson(map);
Document doc = Jsoup.connect("localhost:8080/api/user/login")
.header("useragent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36")
.requestBody(parameter)
.ignoreContentType(true)
.post();
Map<String,Object> map = new HashMap<>();
map.put("page_size","100")
map.put("ps", "100")
map.put("page_flag", "true")
Document doc = Jsoup.connect("http://www.zgetfl.org/qget/main_qget/sqgl/apLcChildAction.do?method=listApLcChildnew")
.header("useragent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36")
.header("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
.data("page_size","100")
.data("ps", "100")
.data("page_flag", "true")
.post();
application/json方式:
Map<String,String> map = new HashMap<>();
map.put("username","aaaa");
map.put("password","123456");
Gson gson = new Gson();
String parameter = gson.toJson(map);
Document doc = Jsoup.connect("localhost:8080/api/user/login")
.header("useragent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36")
.requestBody(parameter)
.ignoreContentType(true)
.post();