0

I'm trying to send curl POST like this. (It's for Slack Webhook)

curl -X POST --data-urlencode "payload={\"username\": \"name\", \"text\": \"Some alert! <https://some.alert.url/|Click Here.>\"}" https://some.channel.url

It Says

The filename, directory name, or volume label syntax is incorrect.

Including "<", "|" throws this error. Tried setting variable, "\<", and so on...

How could I send this url properly?

tried replacing " to ' tried replacing " to '

tried putting \ before <, > enter image description here

coucou
  • 593
  • 2
  • 7
  • 11

1 Answers1

0

Answering myself.

I'm running this on Windows cmd. So I should not use "" but "^" for the escape character.

curl -X POST --data-urlencode "payload={\"username\": \"name\", \"text\": \"Some alert! ^<https://some.alert.url/|Click Here.^>\"}" https://some.channel.url

This works fine.

Escape angle brackets in a Windows command prompt

coucou
  • 593
  • 2
  • 7
  • 11