当前位置:网站首页>Request and response
Request and response
2022-07-02 23:30:00 【pengege666】
List of articles
Request mapping path
Team multiplayer development , Each person sets a different request path , How to solve the conflict — Set the module name as the request path prefix
Use postman The software sends a request
Request parameters
General parameter
Send with parameters Get request
Experimental operation
@Controller
@RequestMapping("/User")
public class UserController {
//2.2 Set the access path of the current operation
@RequestMapping("/save")
@ResponseBody
public String save(String name){
System.out.println(name);
System.out.println("user save ...");
return "{'module':'springmvc'}";
}
}
When requesting parameter name and formal parameter variable name Different when , Use RequestParam Solve .
Send with parameters Post request
Be careful Post How the request is sent
POJO Parameters
public class User {
String name;
int id;
// Omit Getter,Setter and ToString Method
}
UserController.java
@Controller
@RequestMapping("/User")
public class UserController {
//2.2 Set the access path of the current operation
@RequestMapping("/save")
@ResponseBody
public String save(User user){
System.out.println(user);
System.out.println("user save ...");
return "{'module':'springmvc'}";
}
}
POJO Nested POJO Parameters
Array parameters
Set parameters
边栏推荐
- RuntimeError: no valid convolution algorithms available in CuDNN
- SQL advanced syntax
- Boost库链接错误解决方案
- Win11自动关机设置在哪?Win11设置自动关机的两种方法
- Ideal car × Oceanbase: when the new forces of car building meet the new forces of database
- 理想汽车×OceanBase:当造车新势力遇上数据库新势力
- [redis notes] compressed list (ziplist)
- Win11麦克风测试在哪里?Win11测试麦克风的方法
- Is 408 not fragrant? The number of universities taking the 408 examination this year has basically not increased!
- Interface switching based on pyqt5 toolbar button -2
猜你喜欢
RecyclerView结合ViewBinding的使用
JDBC教程
Typical case of data annotation: how does jinglianwen technology help enterprises build data solutions
Win11如何开启目视控制?Win11开启目视控制的方法
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
BBR encounters cubic
Mapper代理开发
Go basic constant definition and use
The concepts of terminal voltage, phase voltage and line voltage in FOC vector control and BLDC control are still unclear
[redis notes] compressed list (ziplist)
随机推荐
Why does RTOS system use MPU?
Alibaba cloud award winning experience: how to use polardb-x
富滇银行完成数字化升级|OceanBase数据库助力布局分布式架构中台
Cryptography -- the mode of block cipher
The concepts of terminal voltage, phase voltage and line voltage in FOC vector control and BLDC control are still unclear
PotPlayer设置最小化的快捷键
基于Pyqt5工具栏按钮可实现界面切换-1
Strictly abide by the construction period and ensure the quality, this AI data annotation company has done it!
@How to use bindsinstance in dagger2
Integration of revolution and batch normalization
Solution: exceptiole 'xxxxx QRTZ_ Locks' doesn't exist and MySQL's my CNF file append lower_ case_ table_ Error message after names startup
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
Eight bit responder [51 single chip microcomputer]
聊聊内存模型与内存序
[redis notes] compressed list (ziplist)
C#中Linq用法汇集
C# MVC创建一个视图摆脱布局的影响
Quantitative analysis of PSNR, SSIM and RMSE
Speech recognition Series 1: speech recognition overview
ADC of stm32