mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 17:54:36 +02:00
gps-track: generate JSON with :serialize
This commit is contained in:
parent
2a232ad2f5
commit
d31afc9ec3
1 changed files with 2 additions and 5 deletions
|
@ -33,11 +33,8 @@
|
|||
:do {
|
||||
/tool/fetch check-certificate=yes-without-crl $GpsTrackUrl output=none \
|
||||
http-method=post http-header-field=({ "Content-Type: application/json" }) \
|
||||
http-data=("{" . \
|
||||
"\"lat\":\"" . ($Gps->"latitude") . "\"," . \
|
||||
"\"lon\":\"" . ($Gps->"longitude") . "\"," . \
|
||||
"\"identity\":\"" . $Identity . "\"" . \
|
||||
"}") as-value;
|
||||
http-data=[ :serialize to=json { "identity"=$Identity; \
|
||||
"lat"=($Gps->"latitude"); "lon"=($Gps->"longitude") } ] as-value;
|
||||
$LogPrint debug $ScriptName ("Sending GPS data in " . $CoordinateFormat . " format: " . \
|
||||
"lat: " . ($Gps->"latitude") . " " . \
|
||||
"lon: " . ($Gps->"longitude"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue