Get multiple request params of the same name

前端 未结 4 968
醉话见心
醉话见心 2020-11-30 06:10

My problem is that with the given code:

from flask import Flask, request

app = Flask(__name__)

@app.route(\"/\")
def hello():
    return str(request.values         


        
4条回答
  •  暖寄归人
    2020-11-30 07:05

    One more way is that you can use one key and one value that holds multiple values and then in the server you can split and do what ever you want .Hope this Helps somewone

    http://localhost/api/products/filters?Manufacturer=Dell|HP|HUAWEI|Lenovo
    

    OR

    http://localhost/api/products/filters?Manufacturer=Dell_HP_HUAWEI_Lenovo
    

    OR

    http://localhost/api/products/filters?Manufacturer=Dell__HP__HUAWEI__Lenovo
    

提交回复
热议问题