Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21064

Scripting • fetch vs curl

$
0
0
Trying to write a script, specifically to hit a webhook on MS Teams. Fetch from both ROS6 and ROS7 result in a "400 Bad Request" from the web server, while curl works just fine.
Code:
[admin@mikrotik] > tool fetch http-method=post mode=https http-header-field="Content: application/json" url=$myURL \ http-data="{\"Summary\":\"Test Summary\",\"title\":\"Test Title\",\"text\":\"Test Message\"}"
Code:
[troy@myserver ~]$ curl -H 'Content-Type: application/json' -d "{\"Summary\":\"Test Summary\",\"title\":\"Test Title\",\"text\":\"Test Message\"}" $myURL
Not even sure how to begin figuring this out.

Statistics: Posted by troy — Fri Jan 12, 2024 4:34 pm



Viewing all articles
Browse latest Browse all 21064

Trending Articles