Sending JSON to Slack in a HTTP POST request

后端 未结 11 736
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 05:21

I\'m trying to send a message using Slack\'s chat.postMessage API call. I have no problems encoding my test messages within HTTP GET, but I\'m trying to achieve the same res

11条回答
  •  生来不讨喜
    2020-12-24 06:00

    Try putting each property in its own -d parameter, like so:

    curl https://slack.com/api/chat.postMessage -X POST -d "channel=#tehchannel" -d "text=teh text" -d "username=teh user" -d "token=teh-token-you-got-from-teh-page-that-machinehead115-linked-to" -d "icon_emoji=:simple_smile:"
    

提交回复
热议问题