当前位置:网站首页>restTemplate详解
restTemplate详解
2022-07-05 13:17:00 【玲珑·】
实践
@Resource
private RestTemplate template;
@PostMapping("/v1/third/add/person")
public void postAddPerson(@RequestBody Person person){
String url = "http://localhost:8081/post/string";
//final Map<String, Object> map = beanToMap(person);
MultiValueMap<String, Object> paramMap = new LinkedMultiValueMap<String, Object>();
paramMap.set("name","tom");
String respnose = template.postForObject(url, paramMap, String.class);
System.out.println(JSON.toJSONString(respnose));
}
案例
bug
如何解决component required a bean of type ‘org.springframework.web.client.RestTempla
边栏推荐
- LB10S-ASEMI整流桥LB10S
- Run, open circuit
- AVC1与H264的区别
- Apicloud studio3 API management and debugging tutorial
- 聊聊异步编程的 7 种实现方式
- Pandora IOT development board learning (HAL Library) - Experiment 7 window watchdog experiment (learning notes)
- 精彩速递|腾讯云数据库6月刊
- 国际自动机工程师学会(SAE International)战略投资几何伙伴
- Halcon template matching actual code (I)
- "Baidu Cup" CTF competition in September, web:sql
猜你喜欢
Natural language processing series (I) introduction overview
Association modeling method in SAP segw transaction code
Introduction to sap ui5 dynamicpage control
无密码身份验证如何保障用户隐私安全?
Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications
It's too convenient. You can complete the code release and approval by nailing it!
百度杯”CTF比赛 2017 二月场,Web:爆破-2
leetcode:221. 最大正方形【dp状态转移的精髓】
先写API文档还是先写代码?
解决 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa2 in position 107
随机推荐
Go array and slice
Rocky基础命令3
从外卖点单浅谈伪需求
Halcon template matching actual code (I)
[深度学习论文笔记]UCTransNet:从transformer的通道角度重新思考U-Net中的跳跃连接
Natural language processing series (I) introduction overview
峰会回顾|保旺达-合规和安全双驱动的数据安全整体防护体系
leetcode:221. 最大正方形【dp状态转移的精髓】
RHCSA8
Detailed explanation of navigation component of openharmony application development
Binder通信过程及ServiceManager创建过程
无密码身份验证如何保障用户隐私安全?
Flutter InkWell & Ink组件
前缀、中缀、后缀表达式「建议收藏」
【Hot100】34. Find the first and last positions of elements in a sorted array
什么是网络端口
使用Dom4j解析XML
go map
The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
函数传递参数小案例