To pass JSON to HTTP POST Request with JavaScript, we call request with an object with the json property.
For instance, we write
request({
url,
method: "POST",
json: requestData,
});
to call request to make a post request to the url.
We set json to requestData JSON string to send the JSON.