import { fetch } from ‘wix-fetch’;
export async function getShortUrls() {
const url = “https://api.short.cm/links/expand”;
const headers = {
“Authorization”: “xxxxxxxxxxxxx”,
“Content-Type”: “application/json”
};
const data = {
“domain”: “shortdomain.cc”,
“path”: “3xd0f2d”
};
const options = {
“method”: “get”,
“headers”: headers,
“body”: data
};
console.log(“Option==>” + JSON.stringify(options));
let response = await fetch(url, options);
console.log(“Option2–>” + JSON.stringify(response));
return response;
}
The response is 400 bad request.
However we use Postman that works.