代码样例:
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
headers.add("currentuser", currentuser);
HttpEntity<T> httpEntity = new HttpEntity<>(param, headers);
restTemplate.exchange(uri, HttpMethod.POST, httpEntity, T.class);
如何获取Header
@RequestHeader("headerKey") String headerValue