def set_json_item ( key , value ) : data = get_json ( ) data [ key ] = value request = get_request ( ) request [ "BODY" ] = json . dumps ( data )
python change dict to request body
manipulate json data on the fly
def set_json_item(key, value):
    """ manipulate json data on the fly
    """
    data = get_json()
    data[key] = value

    request = get_request()
    request["BODY"] = json.dumps(data)