当前位置:网站首页>Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
2022-07-03 10:36:00 【借一縷月光】
idea中,前端訪問localhost:8001/payment/create?serial=333,報下列錯誤 。
Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported]
原因分析:postman中發送請求:localhost:8001/payment/create?serial=333,類型是x-www-form-urlencoded;charset=UTF-8 ,而我們在後端裏使用了@RequestBody,只能接收前端傳過來的json數據。
解决方案:
方案一:去掉@RequestBody注解,可以采用@RequestParam接收就行,前端和後臺數據對應
方案二:在postman中就采用json格式
{
"serial":"12313",
"name":"韻昇初"
}
边栏推荐
- Tensorflow—Neural Style Transfer
- Hands on deep learning pytorch version exercise solution - 2.5 automatic differentiation
- 神经网络入门之预备知识(PyTorch)
- Stroke prediction: Bayesian
- MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法
- 权重衰退(PyTorch)
- Yolov5 creates and trains its own data set to realize mask wearing detection
- Rewrite Boston house price forecast task (using paddlepaddlepaddle)
- Simple real-time gesture recognition based on OpenCV (including code)
- Tensorflow - tensorflow Foundation
猜你喜欢
七、MySQL之数据定义语言(二)
Hands on deep learning pytorch version exercise solution - 3.1 linear regression
一个30岁的测试员无比挣扎的故事,连躺平都是奢望
The imitation of jd.com e-commerce project is coming
C#项目-寝室管理系统(1)
神经网络入门之矩阵计算(Pytorch)
Hands on deep learning pytorch version exercise solution - 2.4 calculus
2018 Lenovo y7000 black apple external display scheme
Out of the box high color background system
Boston house price forecast (tensorflow2.9 practice)
随机推荐
A complete answer sheet recognition system
Secure in mysql8.0 under Windows_ file_ Priv is null solution
What did I read in order to understand the to do list
八、MySQL之事务控制语言
波士顿房价预测(TensorFlow2.9实践)
Leetcode skimming ---10
Multi-Task Feature Learning for Knowledge Graph Enhanced Recommendation
Raspberry pie 4B deploys lnmp+tor and builds a website on dark web
Numpy Foundation
Automatic derivation of introduction to deep learning (pytoch)
[LZY learning notes -dive into deep learning] math preparation 2.1-2.4
Seata分布式事务失效,不生效(事务不回滚)的常见场景
EFFICIENT PROBABILISTIC LOGIC REASONING WITH GRAPH NEURAL NETWORKS
What useful materials have I learned from when installing QT
20220604 Mathematics: square root of X
Configure opencv in QT Creator
Hands on deep learning pytorch version exercise solution-3.3 simple implementation of linear regression
Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
Linear regression of introduction to deep learning (pytorch)
神经网络入门之预备知识(PyTorch)