首页 > 解决方案 > Showing data from REST API

问题描述

I have to fetch data from an API and show it in a HTML table. I am trying to manually test the API using Postman but it is showing the following error

{
    "errors": [
        {
            "keyword": "type",
            "dataPath": "",
            "schemaPath": "#/type",
            "params": {
                "type": "object"
            },
            "message": "should be object"
        }
    ],
    "meta": {
        "schema": {
            "$ref": "xxxxxxx#/definitions/ban/links/0/schema"
        }
    }
}

It uses Oauth 2.0 and I'm trying to set the token in the URL as follows

https://api.xxxxxxxx.com/bans?Authorization=Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6ImRhOWRiMTU0ZDkwMjY5ZWIiLxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

标签: restapioauth-2.0

解决方案


我得到了我的问题的答案。我在标头和 url 中使用了令牌。


推荐阅读