Function Request

Hi,

I’m looking to create a function to reture a value from an HTTP Get comand. or HTTP Head comand.

Currently

GET > http://x.x.x.x/devices/statistics/online-count

Will return an integer however in order to get it into the device appearance i need it in a function. How do i go about this?


m

Search the forum, already explained with examples how to save the “get” from fetch to file and after that read the file content as value.

Thanks Rextended,

I’ve been searching and searching for examples but i haven’t found anything helpful. Maybe i’m searching for the wrong thing. I’ll have another go using what you’ve put but if you have any pointers that would be great.

m

https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch#Return_value_to_a_variable

I literally wrote you what needs to be done, and let you think, rather than just copy & paste…

:put  ([/tool fetch url="http://x.x.x.x/devices/statistics/online-count" as-value output=user]->"data")