fix: task runner client set http header

This commit is contained in:
CaptainB 2024-08-09 14:23:16 +08:00
parent cb52137fdb
commit 9b954e3abb
1 changed files with 1 additions and 0 deletions

View File

@ -48,6 +48,7 @@ public class TaskRunnerClient {
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"); headers.add(HttpHeaders.CONTENT_TYPE, "application/json");
headers.add(HttpHeaders.ACCEPT, "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();