KeepSafe/aiohttp — pull request #153 by kxepal (2014-09-17 10:34:55+00:00)
Title: Send raw files as is

This fixes the behavior when on attempt to POST file object or BytesIO
aiohttp instead of sending their content as is wraps them with multipart
request what isn't welcome for most cases.

This commit changes that behavior: if you call aiohttp.request with
data parameter as file or BytesIO, it will send them as raw binary
chunked stream. In case of files, when Content-Type header isn't set
aiohttp will try to guess the mimetype using the mimetypes module.
Otherwise default 'application/octet-stream' will be used.

There are also checks for StringIO and files opened in text mode: both
aren't allowed since they may cause to send data using not the encoding
you expected to.