@app.route("<STR_LIT>", methods=["<STR_LIT:POST>"])<EOL>def node_transmit(node_id):
exp = Experiment(session)<EOL>what = request_parameter(parameter="<STR_LIT>", optional=True)<EOL>to_whom = request_parameter(parameter="<STR_LIT>", optional=True)<EOL>node = models.Node.query.get(node_id)<EOL>if node is None:<EOL><INDENT>return error_response(error_type="<STR_LIT>")<EOL><DEDENT>if what is not None:<EOL><INDENT>try:<EOL><INDENT>what = int(what)<EOL>what = models.Info.query.get(what)<EOL>if what is None:<EOL><INDENT>return error_response(<EOL>error_type="<STR_LIT>",<EOL>participant=node.participant,<EOL>)<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>try:<EOL><INDENT>what = exp.known_classes[what]<EOL><DEDENT>except KeyError:<EOL><INDENT>msg = "<STR_LIT>"<EOL>return error_response(<EOL>error_type=msg.format(what), participant=node.participant<EOL>)<EOL><DEDENT><DEDENT><DEDENT>if to_whom is not None:<EOL><INDENT>try:<EOL><INDENT>to_whom = int(to_whom)<EOL>to_whom = models.Node.query.get(to_whom)<EOL>if to_whom is None:<EOL><INDENT>return error_response(<EOL>error_type="<STR_LIT>",<EOL>participant=node.participant,<EOL>)<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>try:<EOL><INDENT>to_whom = exp.known_classes[to_whom]<EOL><DEDENT>except KeyError:<EOL><INDENT>msg = "<STR_LIT>"<EOL>return error_response(<EOL>error_type=msg.format(to_whom), participant=node.participant<EOL>)<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>transmissions = node.transmit(what=what, to_whom=to_whom)<EOL>for t in transmissions:<EOL><INDENT>assign_properties(t)<EOL><DEDENT>session.commit()<EOL>exp.transmission_post_request(node=node, transmissions=transmissions)<EOL>session.commit()<EOL><DEDENT>except Exception:<EOL><INDENT>return error_response(<EOL>error_type="<STR_LIT>", participant=node.participant<EOL>)<EOL><DEDENT>return success_response(transmissions=[t.__json__() for t in transmissions])<EOL>
Transmit to another node.

    The sender's node id must be specified in the url.

    As with node.transmit() the key parameters are what and to_whom. However,
    the values these accept are more limited than for the back end due to the
    necessity of serialization.

    If what and to_whom are not specified they will default to None.
    Alternatively you can pass an int (e.g. '5') or a class name (e.g. 'Info' or
    'Agent'). Passing an int will get that info/node, passing a class name will
    pass the class. Note that if the class you are specifying is a custom class
    it will need to be added to the dictionary of known_classes in your
    experiment code.

    You may also pass the values property1, property2, property3, property4,
    property5 and details. If passed this will fill in the relevant values of
    the transmissions created with the values you specified.

    For example, to transmit all infos of type Meme to the node with id 10:
    dallinger.post(
        "/node/" + my_node_id + "/transmit",
        {what: "Meme",
         to_whom: 10}
    );