aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-04-12 11:10:34 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-04-15 09:11:25 +0200
commitd31afc9ec330634a2b66b346ee2d830ea5e5d436 (patch)
tree690bb01f954214ec63acf21e9cec2ee7f7d0a73e
parent2a232ad2f5eef4b60c97306ef731bc5883bf5cfb (diff)
gps-track: generate JSON with :serializerouteros-7.13-8
-rw-r--r--gps-track.rsc7
1 files changed, 2 insertions, 5 deletions
diff --git a/gps-track.rsc b/gps-track.rsc
index dbca38a..f78dfe7 100644
--- a/gps-track.rsc
+++ b/gps-track.rsc
@@ -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"));