JSON API errors
Posted: Monday 18 March 2024 11:26
I can use e.g.
via either a browser or nodejs and axios.get and it always works. However, if I try e.g.
then it works via the browser as evidenced by
{
"status" : "OK",
"title" : "SetUsed"
}
but fails via nodejs and axios.get, as evidenced by
{ status: 'ERR' }
Does anybody have any idea why going via the browser would make a difference? It's a shame that the only error message is 'ERR' as it doesn't tell me much...
Code: Select all
/json.htm?type=command¶m=switchlight&idx=655&switchcmd=Toggle
Code: Select all
/json.htm?type=command¶m=setused&idx=601&setpoint=15.0&mode=FollowSchedule&used=true
{
"status" : "OK",
"title" : "SetUsed"
}
but fails via nodejs and axios.get, as evidenced by
{ status: 'ERR' }
Does anybody have any idea why going via the browser would make a difference? It's a shame that the only error message is 'ERR' as it doesn't tell me much...