1

I am working with a classic asp website on an IIS web server.

When I look at the request.serverVariables collection (which contains request http headers and server variables, etc.), I am seeing the following two, which in my specific set-up are producing 100% identical values.

CONTENT_LENGTH
HTTP_CONTENT_LENGTH

In the mozilla docs, it lists [Content-Length][1] as:

The Content-Length entity header is indicating the size of the entity-body, in bytes, sent to the recipient.

I think it's refering to what I am seeing as HTTP_CONTENT_LENGTH

Then, in the IIS docs for Server Variables, it lists CONTENT_LENGTH as

The length of the request body.

Is this just an IIS thing where the CONTENT_LENGTH is just the server's own internal copy of the HTTP_CONTENT_LENGTH header sent back? (or do I have that backwards)?

Is there any difference between the two e.g. some other cases where the values of each could be different if a certain scenario occurs?

1 Answer 1

1

HTTP_CONTENT_LENGTH is specific to IIS, and in fact returns the raw value of the CONTENT_LENGTH header. (CONTENT_LENGTH is available on all server environments).

For reference, this Visual COBOL documentation Server Variable's Reference page lists this and many other IIS specific variables. http://documentation.microfocus.com/help/index.jsp?topic=%2FGUID-80E5C7E2-6B33-40F2-AA69-CA301927FA8F%2FGUID-AB547FFE-B2EF-44A2-95BE-3B26175C158B.html

2
  • So then HTTP_CONTENT_LENGTH is a completely redundant copy of the standard http header (CONTENT_LENGTH)? E.G. there would be no possible cases of theses two containing different values?
    – GWR
    Nov 20, 2017 at 19:08
  • affirmative, the values would always be identical. Nov 20, 2017 at 19:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .