Content-Length is not provided in header response when sending get requests

Hi There,

When I send a HEAD request to play for example to see the size of the payload I am about to download:

curl -I -X HEAD 'https://play.dhis2.org/2.32.2/api/dataElements' -u admin:district

The Content-Length is not included.

However when I send a HEAD request which includes the content, I get the Content-Length included in a second header which comes as part of the body!?

curl -i HEAD 'https://play.dhis2.org/2.32.2/api/dataElements' -u admin:district

I am trying to use the content length header to track download progress, so I am interested in how to get the content length before fetching the full payload.

Any help would be much appreciated!

Best regards,
Pete

1 Like