I am faced with a web-based service where I can fill a form in the Chrome browser and click the submit button. Alas, I need to do the repetitive fill/submit routine dozens of times, which is error-prone.
I looked at the page source, the form looks like
<form method="post" id="add-form">
...
<button type="submit" ...>Submit</button>
</form>
I this gives me hope that I should be able to automate the process by creating a template JSON, editing it programmatically, and feeding it to multiple curl --data invocations (or maybe --form instead?)
Q0: is this still the right place to ask this question? (maybe there is already a special SE site for such?)
Q1: how do I figure out what exactly is sent by chrome on submit? (chrome has inspect menu option - is this relevant?) Should I use --form or --data?
Q2: how do I figure out where the POST is sent to? (end-point URL)
PS. I cannot use Firefox or Brave here; MS Edge is the only alternative.
<form method="post">does not use JSON - it usesapplication/x-www-form-urlencodedwhich is a flat list ofname+valuepairs (nameis nonunique, otherwise it'd bekey+valuepairs).action=""attribute will be submitted to the same URI as the page itself - so use whatever is in your Address-bar - otherwise the POST request's URI will be in the Network tab, as with the above..shtext-file with the field-values in - just open, edit, save, and run./do-request.sh.