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

边栏推荐
- C#中Linq用法汇集
- Win11系统explorer频繁卡死无响应的三种解决方法
- Remote connection of raspberry pie by VNC viewer
- 详解Promise使用
- 20220527_ Database process_ Statement retention
- 采用VNC Viewer方式遠程連接樹莓派
- Use redis to realize self increment serial number
- 聊聊内存模型与内存序
- Yolox enhanced feature extraction network panet analysis
- [error record] the flutter reports an error (could not resolve io.flutter:flutter_embedding_debug:1.0.0.)
猜你喜欢

密码技术---分组密码的模式

JSON数据传递参数

Typical case of data annotation: how does jinglianwen technology help enterprises build data solutions
![Third party payment function test point [Hangzhou multi tester _ Wang Sir] [Hangzhou multi tester]](/img/d8/d22cbbaccb1594ee46aca098c41002.png)
Third party payment function test point [Hangzhou multi tester _ Wang Sir] [Hangzhou multi tester]

潘多拉 IOT 开发板学习(HAL 库)—— 实验4 串口通讯实验(学习笔记)

What can I do after buying a domain name?

Prometheus deployment

Yolox enhanced feature extraction network panet analysis

Use redis to realize self increment serial number

Alibaba cloud award winning experience: how to use polardb-x
随机推荐
基于Pyqt5工具栏按钮可实现界面切换-2
Load balancing cluster (LBC)
非路由组件之头部组件和底部组件书写
[analysis of STL source code] imitation function (to be supplemented)
JSON数据传递参数
BBR 遭遇 CUBIC
What can I do after buying a domain name?
Redis expiration policy +conf record
Doorplate making C language
Fudian bank completes the digital upgrade | oceanbase database helps to layout the distributed architecture of the middle office
Cryptography -- the mode of block cipher
Boost库链接错误解决方案
Compose 中的 'ViewPager' 详解 | 开发者说·DTalk
Talk about memory model and memory order
2022年最新最全软件测试面试题大全
Pandora IOT development board learning (HAL Library) - Experiment 3 key input experiment (learning notes)
第三方支付功能测试点【杭州多测师_王sir】【杭州多测师】
VIM interval deletion note
Go project operation method
C#中Linq用法汇集