Read bytes from the request body and return or write them to a
file.
A number of bytes less than or equal to the 'size' argument are read
off the socket. The actual number of bytes read are tracked in
self.bytes_read. The number may be smaller than 'size' when 1) the client
sends fewer bytes, 2) the 'Content-Length' request header specifies fewer
bytes than requested, or 3) the number of bytes read exceeds
self.maxbytes (in which case, 413 is raised).
If the 'fp_out' argument is None (the default), all bytes read are
returned in a single byte string.
If the 'fp_out' argument is not None, it must be a file-like object
that supports the 'write' method; all bytes read will be written to the
fp, and None is returned.
|