Performing HTTP get to website on a schedule

Hi,

I’ve recently purchased a Mikrotik router (RB750GL) for my home and would appreciate some advise on how I might be able to accomplish a task.

Currently, I periodically use my notebook to run a Linux command (curl) to download some metadata from a website over https. For example:
curl https://api.somewebsite.com/

I would get a response from the website but I’m not so interested in the response, more on performing the http get.

I was doing some googling around and came across the fetch tool in Mikrotik. In many of the examples that I have seen, it was used to ‘fetch’ a specific file though. I tried it to use it but seem to always get an error saying invalid url. I tried:
fetch url=“https://api.somewebsite.com” mode=https

Is it possible to perform this on my Mikrotik router? I’m running on RouterOS 6.3.2. I’d also like to be able to run this based on a schedule. Any advise would be much appreciated.

Thank you.

If your URL is something that is a folder or directory index, then make sure your url ends with a /
(http://www.google.com = invalid url, while http://www.google.com/ is a valid url)

Browsers just insert the trailing slash for the user instead of being finnicky.

If your url ends with a file name (e.g. index.html, default.php, or api.cgi?x=123&y=456) then the trailing slash would be invalid.