Spring Boot:在拦截器中添加请求参数

时间:2018-10-11 08:33:05

标签: spring spring-boot

发出请求时,我需要添加一个参数:

当前,我正在使用拦截器添加标头。但是,我反对如何向当前请求中添加参数:

@Override
public ClientHttpResponse intercept(
    HttpRequest request,
    byte[] body,
    ClientHttpRequestExecution execution
    ) throws IOException {

        //Adding headers
        request
            .getHeaders()
            .set(
                HttpHeaders.AUTHORIZATION,
                this.jwtService.getBearer()
            );

        //HOW TO ADD REQUEST PARAMETER HERE???

        return execution.execute(request, body);
}

有什么想法吗?

0 个答案:

没有答案