【问题标题】:Add param curl -d in POSTMAN在 POSTMAN 中添加参数 curl -d
【发布时间】:2016-05-29 16:24:09
【问题描述】:

我尝试执行下一个 CURL。

如何在 POSTMAN 中添加参数 -d

curl https://core.spreedly.com/v1/gateways.json \
  -u 'Ll6fAtoVSTyVMlJEmtpoJV8S:RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSy' \
  -H 'Content-Type: application/json' \
  -d '{
        "gateway": {
          "gateway_type": "test"
        }
      }'

PostmanExample

【问题讨论】:

    标签: curl postman


    【解决方案1】:

    -d 是 POST 数据。

    您需要将您的 JSON 数据添加到请求的正文部分,并将请求方法设置为 POST

    例如

    【讨论】:

    • 当我尝试从 Postman 发送 POST 时,Elasticsearch 给我一个错误。 ES 的 curl 是带有 -d 的 GET: curl -X GET "localhost:9200/my_store/products/_search" -H 'Content-Type: application/json' -d' { "query" : { "constant_score" : { "filter" : { "terms" : { "price" : [20, 30] } } } } } '
    • @NateUni 一个在其正文中包含数据的 GET 请求?我不这么认为。
    猜你喜欢
    • 2016-05-29
    • 2015-01-04
    • 1970-01-01
    • 2019-07-19
    • 2017-11-19
    • 1970-01-01
    • 2016-01-14
    • 2019-07-20
    • 1970-01-01
    相关资源
    最近更新 更多