What's the "Content-Length" field in HTTP header?

eonil picture eonil · May 5, 2010 · Viewed 475.2k times · Source

What does it mean?

  1. Byte count of encoded content string with encoding specified in header.
  2. Character count of content string.

Especially in case of Content-Type: application/x-www-form-urlencoded.

Answer

Tom Cabanski picture Tom Cabanski · May 5, 2010

It's the number of bytes of data in the body of the request or response. The body is the part that comes after the blank line below the headers.