This configuration will not compress the request body, just add a header by OlgaMaciaszek‘s comment The test is indeed like this.

https://github.com/spring-cloud/spring-cloud-openfeign/issues/635

Sorry I can't reopen it ,so create new issue.

Comment From: OlgaMaciaszek

The function is to signal to the server that a compressed body is expected by the client. It is the responsibility of the server-side app to provide the compressed body based on the headers provided by the client.

You can find more information here.

Comment From: childewuque

Thanks. But your above comment may be for feign.compression.response.enabled: true, not for feign.compression.request.enabled: true

For feign.compression.request.enabled: true , please look at line 48 of FeignContentGzipEncodingInterceptor class in spring-cloud-openfeign-core 2.2.6.RELEASE:

addHeader(template, HttpEncoding.CONTENT_ENCODING_HEADER,HttpEncoding.GZIP_ENCODING, HttpEncoding.DEFLATE_ENCODING);

It will add header:Content-Encoding: gzip,deflate,but the request body is not compressed.

So my question is : What is the meaning of feign.compression.request.enabled: true,is it just adding a header? Thanks again.

Comment From: childewuque

@OlgaMaciaszek

Comment From: childewuque

@spring-cloud-issues @spencergibb @ryanjbaxter @OlgaMaciaszek Can anyone help explain the above problem? Thanks.

Comment From: childewuque

https://github.com/spring-cloud/spring-cloud-openfeign/issues/639#issuecomment-988862953 @OlgaMaciaszek Isn't the function you described above the function of feign.compression.response.enabled=true? I'm guessing you are confusing feign.compression.request.enabled and feign.compression.response.enabled. Looking forward to your answer, thanks.

Assuming mime-types and min-request-size are eligible,if feign.compression.request.enabled is true openfeign does not add header: Accept-Encoding but Content-Encoding.

You can check line 48 of FeignContentGzipEncodingInterceptor class in spring-cloud-openfeign-core 2.2.6.RELEASE:

public void apply(RequestTemplate template) {

    if (requiresCompression(template)) {
        addHeader(template, HttpEncoding.CONTENT_ENCODING_HEADER,
                HttpEncoding.GZIP_ENCODING, HttpEncoding.DEFLATE_ENCODING);
    }
}

Comment From: ChangJianLiu-Key

Thanks. But your above comment may be for feign.compression.response.enabled: true, not for feign.compression.request.enabled: true

For feign.compression.request.enabled: true , please look at line 48 of FeignContentGzipEncodingInterceptor class in spring-cloud-openfeign-core 2.2.6.RELEASE:

addHeader(template, HttpEncoding.CONTENT_ENCODING_HEADER,HttpEncoding.GZIP_ENCODING, HttpEncoding.DEFLATE_ENCODING);

It will add header:Content-Encoding: gzip,deflate,but the request body is not compressed.

So my question is : What is the meaning of feign.compression.request.enabled: true,is it just adding a header? Thanks again.

Why hasn't anyone answered this question? I also found out that the request and response did not really compress the Body. after adding the configuration according to the example, the data was not really compressed, only the GIZP Head header was added, why is that? I also expect the answer.