rest - 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
解决方案
我得到了我的问题的答案。我在标头和 url 中使用了令牌。
推荐阅读
- android-studio - Room 无法验证数据完整性和空数据崩溃
- docusignapi - 是否有其他 API 可以使用 Docusign CLM 中的预定义模板创建协议?
- java - 通过父更新删除添加子实体列表
- javascript - 错误:PostCSS 插件 tailwindcss 需要 PostCSS 8
- spring - 在 Spring Boot 中同时在多个服务器实例中运行计划任务
- reactjs - 使用axios获取json数据后,程序无法读取属性“TypeError: Cannot read property”
- javascript - 谷歌应用脚本返回“提供的属性没有值”
- excel - 基于另一列的条件转换许多动态列 - 使用生成的列表馈送 Record.TransformFields
- flutter - 从工厂方法返回的类的读取属性:getter 'name' 没有为类型'Future 定义
' - reactjs - 无法读取 react.js 上未定义的属性“地图”