如何进行resttemplate配置以通过https进行呼叫,响应将为302重定向。
服务器在对令牌进行身份验证之后,尝试通过https:// bearer令牌通过https对服务器进行休息模板调用。
String redirectUrl="https://example.com/redirect";
String authHeader="Bearer eyJhbGciO";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
requestHeaders.set("Authorization", authHeader);
Map<String, Object> uriVariables = new HashMap<>();
HttpEntity<String> requestEntity = new HttpEntity<>(null, requestHeaders);
ResponseEntity<ModelAndView> modelres = restTemplate.exchange(redirectUrl,HttpMethod.GET,requestEntity, ModelAndView.class,uriVariables);
如何通过https拨打休息客户电话?