const url = " https://nimbus.wialon.com/api/depot/4054/routes ";
fetch (url, {
método: "GET",
con credenciales: verdadero,
encabezados: {
"Autorización": "Token 3d188d86b6384e3fb71c71d919831f52",
"Content-Type": "application / json"
}
})
.then (resp => resp.json())
.then (function (data) {
console.log(data.routes).lenght;
})
我注意到某些错别字和信息可能会丢失。通过轻微的语法修复,我看到收到了响应。似乎存在用户身份验证问题,但是与服务器的通信似乎正常。
const url = " https://nimbus.wialon.com/api/depot/4054/routes ";
fetch(url, {
método: "GET",
credenciales: 'verdadero',
encabezados: {
Autorización: "Token 3d188d86b6384e3fb71c71d919831f52",
"Content-Type": "application / json"
}
})
.then(resp => resp.json())
.then(function(data) {
console.log("response: ", data);
});