简体   繁体   English

API REST NodeJS

[英]API REST NodeJS

I am making an API REST with axios to get the data.我正在制作一个 API REST 和 axios 来获取数据。 This data is recieved correctly but when I access to the object it gaves me an error since the object is @graph, an mabe is because it has an special character.该数据已正确接收,但是当我访问 object 时,它给了我一个错误,因为 object 是 @graph,mabe 是因为它有一个特殊字符。 ¿How can i access to @graph? ¿我如何访问@graph?

Object in the API i am trying to access我正在尝试访问 API 中的 Object

Code I have implement and error to access @graph我已经实现的代码和访问@graph的错误

If someone could help me.如果有人可以帮助我。 Thanks谢谢

 let test = { "@graph": "test value" }; console.log(test["@graph"]);

try with尝试

console.log(url.data["@graph"])

cheers干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM