可以尝试使用以下代码:
const axios = require('axios');
axios.get('https://example.com/')
.then(response => {
console.log(response.data);
})
.catch(error => {
console.log(error);
});
如果这段代码仍然返回错误503,则可以尝试使用网络代理或更改API端点地址。如果Postman仍然可以正常工作,则可以尝试查看该应用程序的请求头和请求正文,以了解其中是否有任何差异。
上一篇:axios返回测试结果