Here is the fetch version of RapidAPI Client.
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3Rvcl9pZCI6InVzZXJfMDFKQzNFU1I4NjQwVlJNUjFYWVlOMEMzWFciLCJhY3Rvcl90eXBlIjoidXNlciIsImF1dGhfaWRlbnRpdHlfaWQiOiJhdXRoaWRfMDFKQzNFU1JBUDhWMFFXRUVWUUFQRzY5REYiLCJhcHBfbWV0YWRhdGEiOnsidXNlcl9pZCI6InVzZXJfMDFKQzNFU1I4NjQwVlJNUjFYWVlOMEMzWFcifSwiaWF0IjoxNzMzOTgxODU0LCJleHAiOjE3MzQwNjgyNTR9.FbxqPo6wuMTTRhShcoarGaeI2DuKRL6P2ET8hDVY5tU'
},
body: new URLSearchParams({})
};
fetch('http://localhost:9000/admin/storrum/orders', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Here is the fetch version when using the dashboard.
fetch("http://localhost:9000/admin/storrum/assign-role", {
"headers": {
"accept": "application/json",
"accept-language": "en-US,en;q=0.9",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-ch-ua": "\"Chromium\";v=\"125\", \"Not.A/Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Linux\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site"
},
"referrer": "http://localhost:5173/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": "{\"roleId\":\"01JC3KAK2WKS8VADE6Z0JR2JDS\",\"userId\":\"user_01JEWX2DX2CHM2TXWSZHS70TBQ\"}",
"method": "POST",
"mode": "cors",
"credentials": "include"
});