How to obtain values of parameters of get request in flask?

前端 未结 2 1878
误落风尘
误落风尘 2020-12-15 14:48

The answer that I found on the web is to use request.args.get. However, I cannot manage it to work. I have the following simple example:

from fl         


        
2条回答
  •  执念已碎
    2020-12-15 15:28

    http://localhost:5000/api/iterators/opel/next?n=5

    For something like the case before

    from flask import Flask, request
    n = request.args.get("n")
    

    Can do the trick

提交回复
热议问题