api gateway 网关设置header

Consumer httpHeaders = httpHeader -> {

    httpHeader.set("token",user);

    httpHeader.set("referer",serverWebExchange.getRequest().getURI().toString());

};

ServerHttpRequest serverHttpRequest = serverWebExchange.getRequest().mutate().headers(httpHeaders).build();

serverWebExchange.mutate().request(serverHttpRequest).build();

serverWebExchange.getRequest().getHeaders();

你可能感兴趣的:(api gateway 网关设置header)