After reviewing this Stack Overflow post titled "JavaScript post request like a form submit", I came across a similar situation. Currently, I have a curl command that performs as expected:
curl -v -X POST -H "application/json" -H "Content-type: application/json" -d 'some json' http://127.0.0.1:9010/api/kpi
However, my challenge lies in converting this into a JavaScript file where it clearly encounters issues.
Seeking assistance from anyone who can guide me on how to successfully implement this in JavaScript.
Appreciate any help provided!