当前位置:网站首页>Request method ‘POST‘ not supported。 Failed to load resource: net::ERR_FAILED
Request method ‘POST‘ not supported。 Failed to load resource: net::ERR_FAILED
2022-08-04 15:35:00 【51CTO】
1、问题描述
技术栈:前后端项目分离(Springboot+Vue+MybatisPlus)
前端报错信息:

后端报错信息:

2、问题分析
这里使用了ResultFul风格的接口设计方式、增删改查对应不同的方法请求、这里错误使用了方法请求导致
3、问题源头
前端调用后台接口的方法

4、解决方法
修改调用后台接口的方法
前端调用后台接口

后台接口设计

5、知识扩展(认识HTTP方法与CRUD动作映射)
动作 | 普通的CRUD的url | 普通的CRUD的HTTP方法 | RestFul的URL | RestFul的HTT方法 |
查询 | Article/id=1 | GET | Article/{id} | GET |
添加 | Article?title=xxx&body=xxx | GET/POST | Article | POST |
修改 | Article/update?id=xxx | GET | Article/{id} | PUT/PATCH |
删除 | Article/delete?id=xxx | GET | Article/{id} | DELETE |

边栏推荐
猜你喜欢

全球电子产品需求放缓,三星手机越南工厂每周只需要干 3~4 天

numpy入门详细代码

ICDE‘22推荐系统论文之Research篇

西安纵横资讯×JNPF:适配中国企业特色,全面集成费用管控体系

Jupyter常用操作总结(强烈建议收藏,持续更新实用操作)

In action: 10 ways to implement delayed tasks, with code!

leetcode: 250. Count subtrees of equal value

Projector reached the party benefits 】 【 beginners entry - brightness projection and curtain selection - from entry to the master

C# SolidWorks二次开发---工程图简单版标注孔信息

Li Mu's deep learning notes are here!
随机推荐
Go Go 简单的很,标准库之 fmt 包的一键入门
DevOps平台中的制品库是什么?有什么用处?
RepVGG学习笔记
GET 和 POST 请求的区别
Game network UDP + FEC + KCP
如何优雅的消除系统重复代码?
Xi'an Zongheng Information × JNPF: Adapt to the characteristics of Chinese enterprises, fully integrate the cost management and control system
JVM Tuning-GC Fundamentals and Tuning Key Analysis
多商户商城系统功能拆解24讲-平台端分销会员
leetcode: 255 Verify preorder traversal sequence binary search tree
2022杭电多校4
聊聊与苹果审核员的爱恨情仇
Redis 高可用
西安纵横资讯×JNPF:适配中国企业特色,全面集成费用管控体系
C# SolidWorks二次开发---工程图简单版标注孔信息
【已解决】allure无法生成json文件和AttributeError: module ‘allure‘ has no attribute ‘severity_level‘
tif转mat
The electromagnetic compatibility EMC protection study notes
指数族分布与最大熵
Codeforces Round #811 A~F