Skip to content

Commit

Permalink
Create httppost_with_toolfetch
Browse files Browse the repository at this point in the history
  • Loading branch information
mqnoy authored Aug 18, 2018
1 parent b2c6dd1 commit 0993d00
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions httppost_with_toolfetch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#--------------------------------
# - created 8-19-2018 2:24 AM
#--------------------------------
:local data "";
:local url "http://localhost/folder/file.php";
:local ipaddress [/ip address get value-name=address number=4];
:local address [:pick $ipaddress 0 [:find $ipaddress "/"]];
:local mtrversion [/system resource get version];

:local rawtime [/system clock get time];
:local time ( [:pick $rawtime 0 8] );

:local mtridentity [/system identity get value-name=name ];
#:log info $mtridentity ;

:set $data "\"$mtridentity\": {\"version\": \"$mtrversion\",\"ip_address\": \"$address\",\"time\": \"$time\"}";

/tool fetch mode=http url="$url" keep-result="no" http-method=post http-data="$data" http-content-type="application/json"

0 comments on commit 0993d00

Please sign in to comment.