Java 如何使用SpringBootDataREST创建的RESTAPI插入
嗨,我是休息的noob,我试着学习如何在SpringBoot中使用它 我使用SpringBootDataREST生成一个Rest服务,由于我没有Rest的所有基础知识,我想知道如何使用POST插入到我的数据库中,因为我有一个如下的get答案Java 如何使用SpringBootDataREST创建的RESTAPI插入,java,spring,rest,spring-boot,Java,Spring,Rest,Spring Boot,嗨,我是休息的noob,我试着学习如何在SpringBoot中使用它 我使用SpringBootDataREST生成一个Rest服务,由于我没有Rest的所有基础知识,我想知道如何使用POST插入到我的数据库中,因为我有一个如下的get答案 我正在使用postman生成请求。我知道我应该使用POST请求,但在做了一些工作和研究之后,我不知道如何编写它 首先,在postman下使用curl很简单,我们必须选择适当的方法来创建我的案例post(因为我将使用put来更新),其次,Spring引导数据
我正在使用postman生成请求。我知道我应该使用POST请求,但在做了一些工作和研究之后,我不知道如何编写它 首先,在postman下使用curl很简单,我们必须选择适当的方法来创建我的案例post(因为我将使用put来更新),其次,Spring引导数据Rest生成的API有很好的文档记录,您可以通过发布到RestApi主机来发现它 为了构建我的帖子,我使用了post:在postman中,我选择了raw和JSON格式的body部分
{
"us_cextusr" : "123158E",
"us_nomusr" : "test",
"us_prnusr" : "loli",
"us_pwdusr" : "123456",
"us_datdeb" : "2018-03-03",
"us_datfin" : "2018-03-03",
"us_nbrerr" : 1,
"us_datcre" : "2018-03-03",
"us_datmaj" : "2018-03-03",
"us_etatusr" : null,
"us_typusr" : null,
"us_lastprg" : null,
"us_nivacc" : null
}
在开始之前,你应该先看看剩下的基本知识,然后再做类似的事情。您可以获得显示的代码,但除非您了解所显示的内容,否则它不会对您有任何好处。请问我能从中得到什么
{
"us_cextusr" : "123158E",
"us_nomusr" : "test",
"us_prnusr" : "loli",
"us_pwdusr" : "123456",
"us_datdeb" : "2018-03-03",
"us_datfin" : "2018-03-03",
"us_nbrerr" : 1,
"us_datcre" : "2018-03-03",
"us_datmaj" : "2018-03-03",
"us_etatusr" : null,
"us_typusr" : null,
"us_lastprg" : null,
"us_nivacc" : null
}