spring - 如何在 RestTemplate 参数中发送 LocalDate
问题描述
String
在下面,我使用名为的参数调用了 Web 服务"samana"
String samana= "000ABC";
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> requestEntity = new HttpEntity<String>(null, headers);
Table res = restTemplate
.exchange("http://localhost:8090/tharindu/findAllComputers?saman=").concat(samana), HttpMethod.GET, requestEntity, Table.class)
.getBody();
如何在 RestTemplate webservice 中传递 LocalDate 参数
LocalDate samana = LocalDate.now();
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> requestEntity = new HttpEntity<String>(null, headers);
Table res = restTemplate
.exchange("http://localhost:8090/tharindu/findAllComputers?saman=").concat(samana), HttpMethod.GET, requestEntity, Table.class)
.getBody();
解决方案
推荐阅读
- javascript - 如何在 Ajax 发布成功之前保持 Html 元素隐藏
- python - 字符串替换为条件
- r - 多次应用叉积(kronecker)
- javascript - 如何在没有 webpack 或类似的浏览器中从 typescript 调用 JS 函数?
- c++ - 在 qt 中编译时出现“未定义的引用”错误
- sql - 在表中创建条目的单向配对(例如,运动队)
- javascript - 从 React 15.6.2 更新到 16 Breaks Web 应用程序
- node-red - 为节点红色格式化图表数据
- php - 在查询中进行另一个查询时仅显示一行
- php - AJAX 从第一个和第二个动态下拉列表自动填充下拉列表