简体   繁体   English

向HTTP POST请求发送参数

[英]sending parameters to HTTP POST request

I want to parse a webpage called autocoder O*NET 我想解析一个称为自动编码器O * NET的网页

so I want to send request to the URL, In an HTTP POST request, the parameters are not sent along with the URL as mentioned in HERE 所以我想送请求到URL,在一个HTTP POST请求,该参数不能与URL中提到一起发送HERE

My question is how I know the parameters I should pass? 我的问题是我如何知道应该传递的参数? in autocoder o*net I consider the textfield in the form as a parameters that I should pass to the url is this right? autocoder o*net我认为formtextfield是应该传递给url的参数,对吗?

Map<String,Object> params = new LinkedHashMap<>();
    params.put("jobtitle", "Back-End Developer");
    params.put("jobdesc", "");
    params.put("educcode", "");
    params.put("naics", "");
    params.put("category", "");
    params.put("employer", "");

Put the params in the http request body.(I suggest you use Jsoup to do it.) 将参数放在http请求正文中。(建议您使用Jsoup来实现。)

you can use the chrome debug mode, like this screenshot 您可以使用chrome调试模式,如以下屏幕截图所示

Unless the operator of the mentioned web site publishes an official api description for the url one can post to, you can only guess which parameters are meaningful. 除非上述网站的运营商发布了可以发布到的url的官方api描述,否则您只能猜测哪些参数有意义。 I haved used the firefox developers tools that are bundled with the browser (version 47.0.1) and found that these are likely to be processed: 我曾经使用过与浏览器捆绑在一起的firefox开发人员工具(版本47.0.1),发现这些工具很可能会得到处理:

  • action 行动
  • view 视图
  • jobtitle 职称
  • jobdesc jobdesc
  • codetype CODETYPE
  • employer 雇主
  • categroy 产品分类
  • educcode educcode
  • naics NAICS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM