import json


def _build_body_as_bytes(channel, message):
    """return HTTP request body as bytes, utf-8 encoded"""
    data_dict = {"channel": channel, "text": message}
    data_str = json.dumps(data_dict)
    return data_str.encode()