当前位置:网站首页>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 09:28: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":"韵升初"
}
边栏推荐
- Hands on deep learning pytorch version exercise solution - 2.5 automatic differentiation
- I really want to be a girl. The first step of programming is to wear women's clothes
- Leetcode-100: same tree
- 【SQL】一篇带你掌握SQL数据库的查询与修改相关操作
- 1. Finite Markov Decision Process
- 丢弃法Dropout(Pytorch)
- Policy gradient Method of Deep Reinforcement learning (Part One)
- Leetcode刷题---852
- Hands on deep learning pytorch version exercise solution - 3.1 linear regression
- [LZY learning notes dive into deep learning] 3.4 3.6 3.7 softmax principle and Implementation
猜你喜欢
CV learning notes - reasoning and training
ECMAScript--》 ES6语法规范 ## Day1
Leetcode-112: path sum
丢弃法Dropout(Pytorch)
Anaconda installation package reported an error packagesnotfounderror: the following packages are not available from current channels:
【C 题集】of Ⅵ
Deep Reinforcement learning with PyTorch
High imitation Netease cloud music
Raspberry pie 4B installs yolov5 to achieve real-time target detection
MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法
随机推荐
Leetcode-106: construct a binary tree according to the sequence of middle and later traversal
Leetcode刷题---278
20220605 Mathematics: divide two numbers
Hands on deep learning pytorch version exercise solution - 2.3 linear algebra
Leetcode刷题---1385
Configure opencv in QT Creator
【毕业季】图匮于丰,防俭于逸;治不忘乱,安不忘危。
QT creator uses OpenCV Pro add
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow
CV learning notes convolutional neural network
I really want to be a girl. The first step of programming is to wear women's clothes
Free online markdown to write a good resume
Ut2016 learning notes
Leetcode-404: sum of left leaves
重写波士顿房价预测任务(使用飞桨paddlepaddle)
Tensorflow—Image segmentation
MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法
[graduation season] the picture is rich, and frugality is easy; Never forget chaos and danger in peace.
Flutter 退出当前操作二次确认怎么做才更优雅?
CV learning notes - BP neural network training example (including detailed calculation process and formula derivation)