简体   繁体   中英

Invalid or unexpected token when referencing @odata.count

I am currently working with an Odata endpoint and am having an issue referencing JSON values with tags including @. The console shows “SyntaxError | Invalid or unexpected token”

JSON Response Body

 pm.test("Your test name", function () { var jsonData = pm.response.json(); pm.expect(jsonData.@odata.count).to.eql(73); }); 

Can someone explain how I reference that value?

 pm.test("Your test name", function() { var jsonData = pm.response.json(); pm.expect(jsonData['@odata.count']).to.eql(73); }); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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