Convenience function to write the object as JSON to the message body and set the content type.
Convenience function to read an object as YAML from the message body.