【问题标题】:Using Curl in the CMD To send a Discord webhook在 CMD 中使用 Curl 发送 Discord webhook
【发布时间】:2020-09-25 09:38:43
【问题描述】:

我想使用 CMD 命令行 Curl 发送 Webhook 但是我发出的命令:

curl -X POST --data '{"content": "Posted Via Command line"}' --header "Content-Type:application/json" discord-webhook-link

返回此消息

curl: (3) [globbing] 第 24 列中不匹配的右大括号/方括号

{“消息”:“400:错误请求”,“代码”:0}

有没有办法通过命令行发送 Discord Webhook 消息?

【问题讨论】:

  • 您的请求正文(由--data 标志提供)格式错误。检查 discord webhook 想要什么。
  • Discord Developer 文档不是很清楚我知道我需要 Json pramarters 但是我在网上找到的代码示例不起作用
  • 我不知道,对不起。

标签: curl cmd discord


【解决方案1】:

以下语法对我有用,不妨试一试。

curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Posted Via Command line\"}" discord-webhook-link

【讨论】:

    猜你喜欢
    • 2020-11-26
    • 2021-10-12
    • 2020-07-10
    • 2019-01-16
    • 2018-09-11
    • 2020-03-20
    • 2019-01-15
    • 2020-04-11
    • 2019-03-05
    相关资源
    最近更新 更多