added support to set a message format

this is basically the same support for formatting the payload as in
the stdout output

i use it for a quick hack to post to a collector of cube
square.github.com/cube
Merge branch 'http-output-message-support'