Spring-cloud-gateway: How can I get response body size of a request in gateway?

Created on 7 Aug 2020  路  3Comments  路  Source: spring-cloud/spring-cloud-gateway

I have created a custom filter in which I want to access size of response body. Is there anyway?

question

All 3 comments

Either the content length header or read the whole response body into memory.

Actually I am new to spring framework and backend.

I tried the content length header. It worked. but sometime we didn't get this header from microservice.

Could you please share a small code for your second method (read the whole response body into memory)? like in term of ServerWebExchange or ServerHttpResponse.

same question here. any updates?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaoyf picture gaoyf  路  3Comments

thirunar picture thirunar  路  6Comments

maoyunfei picture maoyunfei  路  3Comments

samtonyclarke picture samtonyclarke  路  3Comments

ryanjbaxter picture ryanjbaxter  路  6Comments