Fix issues #144 and #145 by parsing the MIME data correctly and providing support for overriding the content type