From d31afc9ec330634a2b66b346ee2d830ea5e5d436 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 12 Apr 2024 11:10:34 +0200 Subject: gps-track: generate JSON with :serialize --- gps-track.rsc | 7 ++----- 1 file 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")); -- cgit v1.2.3-54-g00ecf