【问题标题】:Which parameters I need to put in the headers and body type while testing in Postman?在 Postman 中进行测试时,我需要在标题和正文类型中放入哪些参数?
【发布时间】:2021-01-15 15:27:00
【问题描述】:
curl -X POST https://api.sandbox.paypal.com/v1/oauth2/token \
-H 'Authorization: Basic {Your Base64-encoded ClientID:Secret}' \
-d 'grant_type=authorization_code&code={authorization_code}'

我正在尝试这个,但没有给我令牌输出。

虽然Authorization: Basic {Your Base64-encoded ClientID:Secret} 标题。 我是不是做错了什么?

这是我在 Postman 中得到的输出。

{
    "name": "AUTHENTICATION_FAILURE",
    "message": "Authentication failed due to invalid authentication credentials or a missing Authorization header.",
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/overview/#error",
            "rel": "information_link"
        }
    ]
}

【问题讨论】:

    标签: paypal authorization postman token


    【解决方案1】:

    添加授权,基本并将客户端ID作为用户名和密码作为秘密

    去掉自定义header basic,postman会自动添加basic认证头

    【讨论】:

      【解决方案2】:

      看起来请求的动作应该是 post 并且在邮递员中看起来你放了 get 动作。

      【讨论】:

      • 我都试过了。但是我没有得到输出。
      猜你喜欢
      • 1970-01-01
      • 2012-02-20
      • 1970-01-01
      • 2021-08-23
      • 2021-08-20
      • 2017-03-24
      • 1970-01-01
      • 2020-04-01
      相关资源
      最近更新 更多