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

边栏推荐
- Fusion de la conversion et de la normalisation des lots
- 公司里只有一个测试是什么体验?听听他们怎么说吧
- Cryptography -- the mode of block cipher
- Markdown basic grammar
- Arduino - character judgment function
- Integration of revolution and batch normalization
- Jinglianwen technology's low price strategy helps AI enterprises reduce model training costs
- Alibaba cloud award winning experience: how to use polardb-x
- Go basic anonymous variable
- PHP get real IP
猜你喜欢

Cryptography -- the mode of block cipher

Writing of head and bottom components of non routing components
![[redis notes] compressed list (ziplist)](/img/83/ff38fabb1baebc5fa4d3d72da315dc.png)
[redis notes] compressed list (ziplist)

为什么RTOS系统要使用MPU?

C# MVC创建一个视图摆脱布局的影响

C MVC creates a view to get rid of the influence of layout

阿里云有奖体验:如何使用 PolarDB-X

"A good programmer is worth five ordinary programmers!"

聊聊内存模型与内存序

MarkDown基本语法
随机推荐
Why can't the start method be called repeatedly? But the run method can?
FOC矢量控制及BLDC控制中的端电压、相电压、线电压等概念别还傻傻分不清楚
Win11系统explorer频繁卡死无响应的三种解决方法
Fudian bank completes the digital upgrade | oceanbase database helps to layout the distributed architecture of the middle office
VIM interval deletion note
CDN 加速,需要域名先备案
Boost库链接错误解决方案
Numerical solution of partial differential equations with MATLAB
Go basic anonymous variable
Hisilicon VI access video process
Win11启用粘滞键关闭不了怎么办?粘滞键取消了但不管用怎么解决
[error record] the flutter reports an error (could not resolve io.flutter:flutter_embedding_debug:1.0.0.)
How does win11 turn on visual control? Win11 method of turning on visual control
Prometheus deployment
基于FPGA的VGA协议实现
内网渗透 | 手把手教你如何进行内网渗透
I've been interviewed. The starting salary is 16K
富滇银行完成数字化升级|OceanBase数据库助力布局分布式架构中台
Li Kou brush questions (2022-6-28)
Solution: exceptiole 'xxxxx QRTZ_ Locks' doesn't exist and MySQL's my CNF file append lower_ case_ table_ Error message after names startup