当我点击网页上的按钮时,我会在开发者工具中获得以下信息:
Request URL:https://example.com/path/eventAction.do
Request Method:POST
Status Code:200 OK
和请求标题如下:
Accept:*/*
Accept-Encoding:gzip, deflate, br
Accept-Language:en-US,en;q=0.9
Connection:keep-alive
Content-Length:1600
Content-Type:multipart/form-data; boundary=----
WebKitFormBoundaryZ9ymd7fGOwOFpELi
Cookie:JSESSIONID=C1rX...
和请求有效负载如:
------WebKitFormBoundaryZ9ymd7fGOwOFpELi
Content-Disposition: form-data; name="example1"
FILTER_900000
------WebKitFormBoundaryZ9ymd7fGOwOFpELi
Content-Disposition: form-data; name="example2"
------WebKitFormBoundaryZ9ymd7fGOwOFpELi
Content-Disposition: form-data; name="example3"
08/03/2018
如何使用Apache HttpClient发送此http帖子,或者是否有其他方法可以使用java代码模仿按钮点击事件..
答案 0 :(得分:0)
HttpPost
对象作为字符串并调用JSON
的{{1}}方法,可以通过HttpPost
请求提交Payload参数。
setEntity