Code: Select all
/tool fetch url="https://api.wedos.com/" http-method=post http-data="{\"request\":{\"command\":\"ping\"}}" output=user-with-headers as-value]
/tool fetch url="https://api.wedos.com/" http-method=post http-data="{\"request\":{\"command\":\"ping\"}}" output=user-with-headers as-value]
{ /ipv6 firewall address-list add address=api.myip.com list=api.myip.com :delay 2s :local ipv6add ([/ipv6 firewall address-list print as-value where comment="api.myip.com"]->0->"address") :set ipv6add [:pick $ipv6add 0 [:find $ipv6add "/" -1] ] :put [/tool fetch host=api.myip.com url="https://api.myip.com/index.php" output=user as-value] :put [/tool fetch host=api.myip.com url="https://$ipv6add/index.php" output=user as-value] remove [find where address=api.myip.com and list=api.myip.com] }
I use RouterOS 7.14 and following row gives this error message "failure: Conflicting hostnames provided in URI and parameter":v6.48.7 working example code
:put [/tool fetch host=api.myip.com url="https://$ipv6add/index.php" output=user as-value]
:put [/tool fetch url="http://$ipv6add/index.php" http-header-field="Host:api.myip.com" output=user as-value]