You have them the wrong way:  the Content-Type should be set to mimetype, and the body should be appended last.