我正在尝试如下操作,但是实际上似乎未在请求中设置标头cookie,反过来,我得到了403禁止响应。我尝试在CURL中使用相同的cookie,它工作正常。所以我认为resttemplate不会将标头Cookie设置为请求
headers.add(HttpHeaders.COOKIE, "name:value");
HttpEntity<BusinessPartner> requestEntity = new HttpEntity<>(businessPartner, headers);
ResponseEntity<String> response = new RestTemplate()
.exchange(updateUrl, HttpMethod.PUT, requestEntity, String.class);