Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

flask recive list

@app.route('/users/', methods=['POST'])
def get_users():
    ids = request.form.getlist('user_ids', type=int)
    users = []

    for id in ids:
        try:
            user = whatever_user_method(id)
            users.append(user)
        except:
            continue

    returns users
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flask #recive #list
ADD COMMENT
Topic
Name
6+1 =