编辑 GitHub 卷曲问题

Edit GitHub Issue with curl

尝试通过 curl.exe(Windows 命令行)在 github 上编辑问题,但我不断收到以下错误。有什么建议吗?

curl 命令

curl -X POST -u "someuser" https://api.github.com/repos/myrepo/myproject/issues/4 -d '{"labels": "["bug"]"}' -H "Content-Type: application/json"

错误信息

{
  "message": "Problems parsing JSON",
  "documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue"
}

我最初的 post 是关于使用 curl 编辑 GitHub 中的一个问题。我正在使用 Windows 命令行来完成它。正如所指出的那样,Windows 命令行中的 '(单引号)不起作用。在 Windows 命令 shell 中,您必须使用外部双引号 字符串并转义任何内部双引号。

以下命令将通过 Windows 命令行运行。

Windows 命令行

curl.exe -X POST -u "someuser" https://api.github.com/repos/myrepo/myproject/issues/4 -d "{\"labels\":[\"bug\"]}" -H "Content-Type: application/json"

以下命令将通过 Linux bash.

起作用

Linux Bash

curl -X POST -u "someuser" https://api.github.com/repos/myrepo/myproject/issues/4 -d '{"labels": ["bug"]}' -H "Content-Type: application/json"