implement HTTP API for post_msg