Trying to make a basic auth API call from Office Script

Yash Shah 0 Reputation points
2025-01-24T06:31:06.65+00:00

Using this and it fails to fetch. Where am I missing it

async function main(workbook: ExcelScript.Workbook) {

const response = await fetch('https://postman-echo.com/basic-auth', {
    method: 'GET',
    headers: {'Authorization':'Basic cG9zdG1hbjpwYXNzd29yZA=='}
});
const jsonData: object[] = await response.json();
console.log(jsonData);  

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,180 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.