java - Spring boot中请求体的默认类型是什么

标签 java spring spring-boot

如果我不发送任何内容(json或xml),Spring boot中@Requestbody的默认类型是什么,它会接受吗?

最佳答案

Whether body content is required. Default is true, leading to an exception thrown in case there is no body content. Switch this to false if you prefer null to be passed when the body content is null.

RequestBody springframework javadoc

关于java - Spring boot中请求体的默认类型是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61928969/

相关文章:

java - 在 Netbeans 中设置 4 个空格选项卡?

java - 在java中格式化当前日期

java - 如何在 native 查询 JPA 中传递参数

java - 无法从 Thymeleaf 表单将值发布到 HTTP 请求

java - 从 Maven : "The parameters ' mainClass' for goal org. codehaus.mojo :exec-maven-plugin:1. 6.0 中的测试范围运行 main:java 丢失或无效”

Java将文件读入ArrayList?

java - JavaFX 中 Spring Autowiring 的空指针异常

spring-boot无法加载JDBC驱动程序类 "org.sqlite.JDBC"

java - application.properties 中的 SpringBoot 未知属性

java - Spring 启动+安全: No Access-Control-Allow-Origin header when setting allowed origins