I have been trying to make a script to restart my FRITZ-Box internet router with the Mikrotik Router, but for some reason I keep facing an error that i can not work around.
I've recreated this same script in Powershell and it has worked without a flaw, but for some reason the same can not be said for the mikrotik router.
Here is the request im sending VIA Mikrotik:
Code: Select all
/tool fetch http-method=post http-header-field="Content-Type: text/xml; charset='utf-8',SoapAction: urn:dslforum-org:service:DeviceConfig:1#Reboot" user="user" password="pass" url="http://blabla" http-data="<?xml version='1.0' encoding='utf-8'?><s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><u:Reboot xmlns:u='urn:dslforum-org:service:DeviceConfig:1'></u:Reboot></s:Body></s:Envelope>"
MIKROTIK:
Code: Select all
POST / HTTP/1.1
Host: xxx.requestcatcher.com
Connection: close
Authorization: Basic ZnJpdHo5ODIxOkthdXRlbmJ1cmdlciM=
Connection: close
Content-Length: 263
Content-Type: text/xml; charset='utf-8'
Content-Type: application/x-www-form-urlencoded
Soapaction: urn:dslforum-org:service:DeviceConfig:1#Reboot
User-Agent: Mikrotik/6.x Fetch
<?xml version='1.0' encoding='utf-8'?><s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><u:Reboot xmlns:u='urn:dslforum-org:service:DeviceConfig:1'></u:Reboot></s:Body></s:Envelope>
Code: Select all
POST / HTTP/1.1
Host: xxx.requestcatcher.com
Content-Length: 263
Content-Type: text/xml; charset='utf-8'
Soapaction: urn:dslforum-org:service:DeviceConfig:1#Reboot
User-Agent: Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.19044; de-IT) PowerShell/7.3.0
<?xml version='1.0' encoding='utf-8'?><s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><u:Reboot xmlns:u='urn:dslforum-org:service:DeviceConfig:1'></u:Reboot></s:Body></s:Envelope>