I have an HTTP POST request that accepts the body as form-data.
grant_type: client_credentials
when I use this API in an application, I need to pass a client_id and client_secret parameter to this call.
so far I have
const postRequest = {
url: 'https://address',
method: 'POST',
headers: {
'authorization': 'Basic xyz',
'content-type': 'application/x-www-form-urlencoded'
},
formData: {
'grant_type': 'client_credentials'
}
};
How do I include the id and secret into this request? I have also tried
formData: {
'grant_type' : 'client_credentials',
'client_id' :'id',
'client_secret' : 'secret'
}
that does not work either as stated in How to use FormData for AJAX file upload?