Please use Rex::MIME::Message to create the POST message.

If you experience problems with extra \r\n you can delete them :) See an usage example at exploits/multi/http/auxilium_upload_exec.rb (there are other samples in the metasploit code base, just pointing one of them :))