def get_relationship(from_id, to_id, rel_name, properties):
    """reformats a NetworkX edge for `generate_data()`.

    :param from_id: the ID of a NetworkX source node
    :param to_id: the ID of a NetworkX target node
    :param rel_name: string that describes the relationship between the
        two nodes
    :param properties: a dictionary of edge attributes
    :rtype: a dictionary representing a Neo4j POST request
    """
    body = {"to": "{{{0}}}".format(to_id), "type": rel_name,
            "data": properties}

    return {"method": "POST",
            "to": "{{{0}}}/relationships".format(from_id),
            "body": body}