当前位置:网站首页>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":"韻昇初"
}
边栏推荐
- Data preprocessing - Data Mining 1
- Powshell's set location: unable to find a solution to the problem of accepting actual parameters
- Synchronous vs asynchronous
- Leetcode skimming ---217
- 20220531 Mathematics: Happy numbers
- MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法
- Leetcode skimming ---75
- Rewrite Boston house price forecast task (using paddlepaddlepaddle)
- 神经网络入门之矩阵计算(Pytorch)
- Knowledge map reasoning -- hybrid neural network and distributed representation reasoning
猜你喜欢

Ut2014 supplementary learning notes

High imitation bosom friend manke comic app

Class-Variant Margin Normalized Softmax Loss for Deep Face Recognition

Ut2012 learning notes

Neural Network Fundamentals (1)

7、 Data definition language of MySQL (2)

熵值法求权重

Hands on deep learning pytorch version exercise solution -- implementation of 3-2 linear regression from scratch

Leetcode - 1172 plate stack (Design - list + small top pile + stack))

8、 Transaction control language of MySQL
随机推荐
[LZY learning notes -dive into deep learning] math preparation 2.1-2.4
权重衰退(PyTorch)
Softmax regression (pytorch)
20220606 Mathematics: fraction to decimal
Leetcode skimming ---202
Standard library header file
Pytorch ADDA code learning notes
6、 Data definition language of MySQL (1)
Content type ‘application/x-www-form-urlencoded; charset=UTF-8‘ not supported
Install yolov3 (Anaconda)
[LZY learning notes dive into deep learning] 3.4 3.6 3.7 softmax principle and Implementation
What did I read in order to understand the to do list
Leetcode刷题---374
Leetcode skimming ---10
20220601 Mathematics: zero after factorial
Hands on deep learning pytorch version exercise solution - 3.1 linear regression
Ut2017 learning notes
2018 Lenovo y7000 black apple external display scheme
ThreadLocal原理及使用场景
20220609 other: most elements