Version DPA 2022.2.7862
Attempting to use Javascript to connect to DPA using API Call. Keep getting error TypeError: Failed to fetch
Connection String is:
var rToken = '---------------------------------------------------------------------------------------------------------------------------------';
fetch('https://*************:****/iwc/api/security/oauth/token', {
method: 'POST',
body: 'grant_type=refresh_token&refresh_token='+rToken,
headers: {
}
}).then(function (resp) {
prompt(resp.statusTest);
}).then(function (data) {
prompt(data.data);
}).catch(function (err) {
prompt(err);
});
I am able to use PowerShell successfully using these parameters, but the HTML page throws an error when JavaScript is used