当前位置:网站首页>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

边栏推荐
- 【ML】李宏毅三:梯度下降&分类(高斯分布)
- Fudian bank completes the digital upgrade | oceanbase database helps to layout the distributed architecture of the middle office
- PHP get real IP
- Eight honors and eight disgraces of the programmer version~
- Redis expiration policy +conf record
- Fusion de la conversion et de la normalisation des lots
- Arduino - 字符判断函数
- Potplayer set minimized shortcut keys
- 可知论与熟能生巧
- How difficult is it to be high? AI rolls into the mathematics circle, and the accuracy rate of advanced mathematics examination is 81%!
猜你喜欢

数字图像处理实验目录

Tiktok actual combat ~ number of likes pop-up box

实现BottomNavigationView和Navigation联动

FOC矢量控制及BLDC控制中的端电压、相电压、线电压等概念别还傻傻分不清楚

“一个优秀程序员可抵五个普通程序员!”

【STL源码剖析】仿函数(待补充)

Intranet penetration | teach you how to conduct intranet penetration hand in hand

Pandora IOT development board learning (HAL Library) - Experiment 4 serial port communication experiment (learning notes)

基于Pyqt5工具栏按钮可实现界面切换-2

程序员版本的八荣八耻~
随机推荐
Talk about memory model and memory order
基于FPGA的VGA协议实现
Speech recognition Series 1: speech recognition overview
Highly available cluster (HAC)
Win11启用粘滞键关闭不了怎么办?粘滞键取消了但不管用怎么解决
非路由组件之头部组件和底部组件书写
Deep analysis of data storage in memory - C language
第三方支付功能测试点【杭州多测师_王sir】【杭州多测师】
Warning: implicitly declaring library function 'printf' with type 'int (const char *,...)‘
Use the scroll bar of souI when using the real window in souI
Numerical solution of partial differential equations with MATLAB
SharedPreferences save list < bean > to local and solve com google. gson. internal. Linkedtreemap cannot be cast to exception
理想汽车×OceanBase:当造车新势力遇上数据库新势力
MarkDown基本语法
Load balancing cluster (LBC)
内网渗透 | 手把手教你如何进行内网渗透
SQL进阶语法
@BindsInstance在Dagger2中怎么使用
海思调用接口之Makefile配置
请求与响应