JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
983 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I use a Polyglot Notebook .NET, .ipynb file, and in the javascript code cell I want to make a request to the server using the built-in fetch method/axios, but for some reason I don’t get anything in the console, there are also no errors. What could be the problem?
require(['axios'], function (axios) {
const url = 'http://myurl.com';
const token = 'token';
const body = {
listFields: [],
searchData: '',
skip: 0,
take: 50,
};
axios.post(url, body, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`,
},
})
.then(response => {
console.log(response.data.dataList);
})
.catch(error => {
console.error(error);
});
})