Termination of POST body

Paul Phillips (paulp@cerf.net)
Mon, 25 Sep 1995 19:42:45 -0700 (PDT)

Netscape/X and Mosaic/X terminate POST bodies with an extra \r\n. My
server has been reading all data available on the socket, which means
that the number of bytes sent to a CGI's stdin is two greater than the
supplied content length.

The spec tells me in section 7.2.2 "... the length of that body may be
determined in one of several ways. If a Content-Length header field is
present, its value in bytes represents [the length]. Otherwise, the body
length is determined by the Content-Type (for types with an explicit
end-of-body delimiter) [...]"

If content-length is supplied, I can use that; no problem. If it is not,
it appears that the "end-of-body delimiter" is the only mechanism for
determining the end of the entity body. This appears to be \r\n based on
these clients' behavior. Is this so?

Or, do all clients in normal use supply content-length, and this is a

Thanks for any help,

Paul Phillips                                 | "Click _here_ if you do not
<URL:mailto:paulp@cerf.net>                   |  have a graphical browser"
<URL:http://www.primus.com/staff/paulp/>      |  -- Canter and Siegel, on
<URL:pots://+1-619-558-3789/is/paul/there?>   |  their short-lived web site