fetch vs curl

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.

[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\"}"



[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.

Your header is wrong:

http-header-field=“Content**-Type**: application/json”

You may want to add output=user, so you can see the results on the screen. Otherwise output is to a file. If it all works, you can add “as-value” to store result to a variable if desired.

I’m BLIND!

Thank you.