关于前端接口传递的方法,推荐按以下使用:

 

若要在服务器上创建资源,推荐使用POST方法

若要检索某个资源,推荐使用GET方法

若要更新资源,推荐使用PUT方法

若要删除某个资源,推荐使用DELETE方法

 


 

 

另外本章主要讲述的是关于前后端通信关于对应性,前端为react的View,会分传递不同值有不同的处理情况。

 

首先关于Springboot内的代码变更都是在IndexController.java内,以下是代码:

package maven.example.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/index")
public class IndexController {

    @RequestMapping("/home")
    public String home() {
        return "Hello World!";
    }
    
}
View Code

相关文章:

  • 2021-05-16
  • 2021-07-27
  • 2022-12-23
  • 2021-08-08
  • 2023-04-04
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
相关资源
相似解决方案