How to connect to DPA API using Javascript Fetch

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) {
}).then(function (data) {
}).catch(function (err) {

I am able to use PowerShell successfully using these parameters, but the HTML page throws an error when JavaScript is used

Parents Reply Children
No Data