在服务器端通过request.getHeaders()是无效的,只能使用response.getHeaders()。
@Override
public Object beforeBodyWrite(Object body,
MethodParameter returnType,
MediaType mediaType,
Class selectedConverterType,
ServerHttpRequest request,
ServerHttpResponse response) {
log.info("{} {}",RestResponseBodyAdvice.class,request.getURI());
response.getHeaders().set("ACCESS-ERP", "0-0-0-0-0-0");
request.getHeaders().set("REQUEST-ERP", "0-0-0-0-0-0");;