Don't really need to pip install mock anymore.
Handle binary data when writing out the content length.