Community discussions

MikroTik App
 
troy
Member
Member
Topic Author
Posts: 320
Joined: Thu Jun 30, 2005 6:47 pm

/tool/fetch - 6.x vs 7.x

Mon Mar 11, 2024 7:25 pm

Trying to send messages to Teams. Should be easy enough, no? Well, not so much. This exact command runs perfectly fine in ROS 7.14, but not in 6.49
/tool fetch http-method=post http-header-field="Content-Type: application/json" http-data="{\"text\": \"Test Message\"}" https://mycompany.webhook.office.com/webhookb2/UUID1@UUID2/IncomingWebhook/LONGSTRING/UUID3
We are not using ROS7 in production yet, so I never even thought to test it on that platform until today, since I have a pair of 2116's on the bench for other testing.

So, what's wrong with the command that it returns a "400 Bad Request" when run from ROS6?
 
zainarbani
Frequent Visitor
Frequent Visitor
Posts: 54
Joined: Thu Jul 22, 2021 9:42 am
Location: Pati, Indonesia

Re: /tool/fetch - 6.x vs 7.x

Thu Mar 14, 2024 3:01 pm

Could be url encoding

Try changes:
@ -> %40
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: /tool/fetch - 6.x vs 7.x

Fri Mar 15, 2024 6:21 pm

Could be url encoding

Try changes:
@ -> %40
And the other non plain characters inside text? Probably non-7-bit-ascii text?
Probably must be all urlencoded (the text part, not all) with my urlencode function.

Who is online

Users browsing this forum: Bing [Bot], gbadrr19, tikworx and 8 guests