Curl命令在语法上不正确

Curl命令在语法上不正确,curl,postman,Curl,Postman,我曾尝试在postman中导入curl命令,但它的给定类型错误 curl -X POST -k foo:foosecret@localhost:9000/hascode/oauth/token \ -d grant_type=password -d client_id=foo -d client_secret=abc123 \ -d redirect_uri=https://www.hascode.com -d username=bar -d password=barsecret

我曾尝试在postman中导入curl命令,但它的给定类型错误

curl -X POST -k foo:foosecret@localhost:9000/hascode/oauth/token \
   -d grant_type=password -d client_id=foo -d client_secret=abc123 \
   -d redirect_uri=https://www.hascode.com -d username=bar -d password=barsecret
以下是截图:

curl命令中有几个问题:

  • 应删除
    \
    。它是从其他地方复制的(作为换行符)
  • 缺少HTTP协议,它应该是
    http://localhost:9000
  • 出现多个
    -d
    。只需要一个
    -d
  • 数据
    https://www.hascode.com
    未编码
可以导入到postman中的工作curl命令如下所示(如果您的服务器接受
application/x-www-form-urlencoded
content-type):


内容中有2\个,看起来像是从其他地方复制的?是的,是复制的,我没有正确的知识。我已尝试删除2\但仍然存在相同的问题。
curl -X POST http://foo:foosecret@localhost:9000/hascode/oauth/token -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=password&client_id=foo&client_secret=abc123&redirect_uri=https%3A%2F%2Fwww.hascode.com&username=bar&password=barsecret'