当前位置:网站首页>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":"韵升初"
}
边栏推荐
- 20220610 other: Task Scheduler
- What useful materials have I learned from when installing QT
- [graduation season] the picture is rich, and frugality is easy; Never forget chaos and danger in peace.
- [C question set] of Ⅵ
- 20220531数学:快乐数
- Realize an online examination system from zero
- One click generate traffic password (exaggerated advertisement title)
- 20220531 Mathematics: Happy numbers
- Standard library header file
- Step 1: teach you to trace the IP address of [phishing email]
猜你喜欢

High imitation Netease cloud music

Powshell's set location: unable to find a solution to the problem of accepting actual parameters

重写波士顿房价预测任务(使用飞桨paddlepaddle)

A complete answer sheet recognition system

Hands on deep learning pytorch version exercise solution - 2.4 calculus

Anaconda安装包 报错packagesNotFoundError: The following packages are not available from current channels:

Policy Gradient Methods of Deep Reinforcement Learning (Part Two)

Judging the connectivity of undirected graphs by the method of similar Union and set search

Label Semantic Aware Pre-training for Few-shot Text Classification

Secure in mysql8.0 under Windows_ file_ Priv is null solution
随机推荐
Leetcode刷题---278
CV learning notes - reasoning and training
One click generate traffic password (exaggerated advertisement title)
Standard library header file
20220607其他:两整数之和
High imitation wechat
Deep learning by Pytorch
Jetson TX2 刷机
ECMAScript -- "ES6 syntax specification # Day1
Leetcode-112:路径总和
Leetcode刷题---1385
20220604 Mathematics: square root of X
Leetcode-106: construct a binary tree according to the sequence of middle and later traversal
Leetcode刷题---852
Leetcode - 705 design hash set (Design)
CV learning notes convolutional neural network
GAOFAN Weibo app
Ut2011 learning notes
2-program logic
20220604数学:x的平方根