fix: task runner client set http header

This commit is contained in:
CaptainB 2024-08-09 13:28:42 +08:00 committed by 刘瑞斌
parent c567ee5bb7
commit 89656beb95
1 changed files with 1 additions and 0 deletions

View File

@ -47,6 +47,7 @@ public class TaskRunnerClient {
String token = totpGenerator.now(); String token = totpGenerator.now();
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.add(MsHttpHeaders.OTP_TOKEN, token); headers.add(MsHttpHeaders.OTP_TOKEN, token);
headers.add(HttpHeaders.CONTENT_TYPE, "application/json");
HttpEntity<String> httpEntity = new HttpEntity<>(headers); HttpEntity<String> httpEntity = new HttpEntity<>(headers);
ResponseEntity<ResultHolder> entity = restTemplateWithTimeOut.exchange(u, HttpMethod.GET, httpEntity, ResultHolder.class, uriVariables); ResponseEntity<ResultHolder> entity = restTemplateWithTimeOut.exchange(u, HttpMethod.GET, httpEntity, ResultHolder.class, uriVariables);
return entity.getBody(); return entity.getBody();