How to fetch response and request size with Response streaming on in order to log it somewhere

  <Property name="**response.streaming.enabled">true**</Property>
      <Property name="**request.streaming.enabled">true**</Property>

I have streaming enabled, i want to fetch the request and response size to log it somewhere.

var requestMessageSize = context.getVariable(“request.header.Content-Length”);
var targetMessageSize = context.getVariable(“response.header.Content-Length”);

Above code seems to be only working when streaming is turned off.

I have seen that Apigee reports are still able to have access to the sizes. Can anyone share if there is a way to fetch from some Apigee flow variables .

I believe headers should still work with streaming enabled. What’s the Transfer-Encoding on the request/response? If it’s chunked then there won’t be a Content-Length and you’re out of luck unfortunately.

Can you see the Content-Length headers in trace with streaming enabled?