【发布时间】:2020-08-26 19:34:46
【问题描述】:
我目前正在使用 Spring 框架构建一个简单的 REST 服务。但是在使用 Postman 进行测试时,我遇到了以下问题: Click to view image
我想知道如何让 Spring 识别接收到的 Content-Type 标头实际上与支持的 application/x-www-form-urlencoded 匹配。
更新:
我目前在 localhost 使用嵌入式 Tomcat 服务器运行我的应用程序。
我的终点简要包括:
- POST:
/api/users- 用于创建新用户 - GET:
/api/users- 用于列出用户 - GET:
/api/users/{id}- 用于通过 id 检索用户
POST 端点的请求正文:
"email":"<your-email>",
"password:"<your-password>"
更新 2:
【问题讨论】:
-
请用您的休息终点更新您的问题
-
不要添加图片,添加你的代码
标签: spring rest http-headers mime-types