0

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();
4

0 回答 0