我正在调用的 api 使用值中包含 @
的内容类型响应我的 resttemplate 调用。
final HttpHeaders headers = new HttpHeaders();
headers.set(HttpHeaders.ACCEPT, "key=abcd@def");
final ResponseEntity<String> responseEntity = resttemplate.exchange(
path, HttpMethod.GET, new HttpEntity<>(null, headers),
String.class);
Response Header
content-type: key=abc@def
我得到的错误
org.springframework.http.InvalidMediaTypeException:
Invalid mime type "key=abcd@def": Invalid token character '@' in token "abcd@def"