I am trying to read some json information from a app which contains the values of my electric and gas usage.
Using the URL in a commandline it looks like:
- Code: Select all
'http://192.168.1.54/api/v2/datalogger/dsmrreading?ordering=-timestamp&limit=1'
/usr/bin/curl -vsk -H 'X-AUTHKEY: 5ZMCOBBXQGKLGJZD3TZZZJYXEMRURXDQABV89HN8HMUPS4P5M56PMZ4A5JRSYSHA' 'http://192.168.1.54/api/v2/datalogger/dsmrreading?ordering=-timestamp&limit=1'
* Trying 192.168.1.54...
* TCP_NODELAY set
* Connected to 192.168.1.54 (192.168.1.54) port 80 (#0)
> GET /api/v2/datalogger/dsmrreading?ordering=-timestamp&limit=1 HTTP/1.1
> Host: 192.168.1.54
> User-Agent: curl/7.54.0
> Accept: */*
> X-AUTHKEY: 5ZMCOBBXQGKLGJZD3TZZZJYXEMRURXDQABV89HN8HMUPS4P5M56PMZ4A5JRSYSHA
>
< HTTP/1.1 200 OK
And this is works.
I am not able to use the single quotes in URL field of the GhostXML device config. Without the single quotes the URL gets the value :
- Code: Select all
GET /api/v2/datalogger/dsmrreading?ordering=-timestamp HTTP/1.1
/usr/bin/curl -vsk -H 'X-AUTHKEY: 5ZMCOBBXQGKLGJZD3TZZZJYXEMRURXDQABV89HN8HMUPS4P5M56PMZ4A5JRSYSHA' http://192.168.1.54/api/v2/datalogger/d ... mp&limit=1
[1] 18256
MacBook-Pro:~ wey3$ * Trying 192.168.1.54...
* TCP_NODELAY set
* Connected to 192.168.1.54 (192.168.1.54) port 80 (#0)
> GET /api/v2/datalogger/dsmrreading?ordering=-timestamp HTTP/1.1
> Host: 192.168.1.54
> User-Agent: curl/7.54.0
> Accept: */*
> X-AUTHKEY: 5ZMCOBBXQGKLGJZD3TZZZJYXEMRURXDQABV89HN8HMUPS4P5M56PMZ4A5JRSYSHA
>
< HTTP/1.1 200 OK
It is possible in some way to use the single quotes in the URL field or can/should I use another notation of the URL?
Thanks
Regards,
Wouter