reactjs - 如何理解 Reactjs 中用于从服务器获取数据的端点
问题描述
我是 Reactjs 的新手,用于获取 api。端点从服务器 192.34.55.55:4000 向我分享后端开发人员,向我展示许多我无法正确理解的端点,我使用令牌获取一个用于登录请求,当我登录重定向时出现问题到像用户这样的私人页面,现在后端开发人员说我使用令牌句柄请求保护 api,但显示错误 400 错误请求错误等。请告诉我如何处理端点,我在互联网上搜索了很多次但找不到正确的答案满足我的要求。
告诉我端点是如何工作的以及我如何在 reactJs 中获取它?
Available routes
session_path POST /api/sign_in FuelUpWeb.SessionController :sign_in
technology_path GET /api/technologies FuelUpWeb.TechnologyController :index
technology_path GET /api/technologies/:id FuelUpWeb.TechnologyController :show
technology_path POST /api/technologies FuelUpWeb.TechnologyController :create
technology_path PATCH /api/technologies/:id FuelUpWeb.TechnologyController :update
PUT /api/technologies/:id FuelUpWeb.TechnologyController :update
technology_path DELETE /api/technologies/:id FuelUpWeb.TechnologyController :delete
sport_path GET /api/sports FuelUpWeb.SportController :index
sport_path GET /api/sports/:id FuelUpWeb.SportController :show
sport_path POST /api/sports FuelUpWeb.SportController :create
sport_path PATCH /api/sports/:id FuelUpWeb.SportController :update
PUT /api/sports/:id FuelUpWeb.SportController :update
sport_path DELETE /api/sports/:id FuelUpWeb.SportController :delete
national_path GET /api/nationals FuelUpWeb.NationalController :index
national_path GET /api/nationals/:id FuelUpWeb.NationalController :show
national_path POST /api/nationals FuelUpWeb.NationalController :create
national_path PATCH /api/nationals/:id FuelUpWeb.NationalController :update
PUT /api/nationals/:id FuelUpWeb.NationalController :update
national_path DELETE /api/nationals/:id FuelUpWeb.NationalController :delete
international_path GET /api/internationals FuelUpWeb.InternationalController :index
international_path GET /api/internationals/:id FuelUpWeb.InternationalController :show
international_path POST /api/internationals FuelUpWeb.InternationalController :create
international_path PATCH /api/internationals/:id FuelUpWeb.InternationalController :update
PUT /api/internationals/:id FuelUpWeb.InternationalController :update
international_path DELETE /api/internationals/:id FuelUpWeb.InternationalController :delete
解决方案
推荐阅读
- php - SQL 从 2 个不同的数据库中检索数据
- function - 如何正确设置衰减学习率回调,并在 xgboost 中将其传递给自定义函数?
- asterisk - 如何限制 Asterisk PJSIP 中的重新注册次数?
- docker - Docker:通过 .ENV 文件访问 JSON 文件
- java - 如何在 Google Drive 中创建一个文件夹并将文件发送到该文件夹而无需用户交互
- html - HTML 在列的最后一行显示项目
- c# - 将阿拉伯日期格式转换为英语:System.FormatException:'字符串未被识别为有效的日期时间。'
- javascript - 如何在 React Native 中的 StyleSheet.create 中继承样式(可能使用解构语法)
- ios - 如何修复 Xcode 的代码缩进错误?
- asp.net-core - 具有 .NetCore 3.0 不记名令牌授权的 SwaggerUI