当前位置:网站首页>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":"韵升初"
}
边栏推荐
- 20220601 Mathematics: zero after factorial
- 20220602数学:Excel表列序号
- Leetcode刷题---189
- 权重衰退(PyTorch)
- ThreadLocal原理及使用场景
- A complete mall system
- Leetcode刷题---367
- Raspberry pie 4B deploys lnmp+tor and builds a website on dark web
- Label Semantic Aware Pre-training for Few-shot Text Classification
- Convolutional neural network (CNN) learning notes (own understanding + own code) - deep learning
猜你喜欢

Realize an online examination system from zero

Model evaluation and selection

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

3.3 Monte Carlo Methods: case study: Blackjack of Policy Improvement of on- & off-policy Evaluation

ThreadLocal原理及使用场景

Hands on deep learning pytorch version exercise solution - 2.4 calculus

波士顿房价预测(TensorFlow2.9实践)

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

Judging the connectivity of undirected graphs by the method of similar Union and set search
随机推荐
Model evaluation and selection
. DLL and Differences between lib files
权重衰退(PyTorch)
3.2 Off-Policy Monte Carlo Methods & case study: Blackjack of off-Policy Evaluation
一个30岁的测试员无比挣扎的故事,连躺平都是奢望
Leetcode刷题---704
Leetcode - 705 design hash set (Design)
Leetcode刷题---217
ECMAScript--》 ES6语法规范 ## Day1
20220608 other: evaluation of inverse Polish expression
实战篇:Oracle 数据库标准版(SE)转换为企业版(EE)
C#项目-寝室管理系统(1)
Yolov5 creates and trains its own data set to realize mask wearing detection
Leetcode刷题---44
Label Semantic Aware Pre-training for Few-shot Text Classification
Data preprocessing - Data Mining 1
Configure opencv in QT Creator
Policy Gradient Methods of Deep Reinforcement Learning (Part Two)
Data classification: support vector machine
A complete answer sheet recognition system