Abeer
Abeer

Reputation: 83

sending parameters to HTTP POST request

I want to parse a webpage called autocoder 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

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?

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", "");

Upvotes: 1

Views: 184

Answers (2)

Matthias
Matthias

Reputation: 3556

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. 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:

  • action
  • view
  • jobtitle
  • jobdesc
  • codetype
  • employer
  • categroy
  • educcode
  • naics

Upvotes: 1

IMXQD
IMXQD

Reputation: 331

Put the params in the http request body.(I suggest you use Jsoup to do it.)

you can use the chrome debug mode, like this screenshot

Upvotes: 1

Related Questions