In Flask, What is request.args and how is it used? : <p>I'm new in Flask. I can't understand how <code>request.args</code> is used. I read somewhere that it is used to return values of query string[correct me if I'm wrong]. And how many parameters <code>request.args.get()</code> takes.
I know that when I have to store submitted form data, I can use</p>

<pre><code>fname = request.form.get("firstname")
</code></pre>

<p>Here, only one parameter is passed.</p>

<p>Consider this code. Pagination has also been done in this code.</p>

<pre><code>@app.route("/")
def home():
    cnx = db_connect()
    cur = cnx.cursor()
    output = []

    page = request.args.get('page', 1)

    try:
        page = int(page)
        skip = (page-1)*4
    except:
        abort(404)

    stmt_select = "select * from posts limit %s, 4;"
    values=[skip]

    cur.execute(stmt_select,values)
    x=cur.fetchall()

    for row in reversed(x):
        data = {
           "uid":row[0],
           "pid":row[1],
           "subject":row[2],
           "post_content":row[3],
           "date":datetime.fromtimestamp(row[4]),
        }
        output.append(data)

    next = page + 1
    previous = page-1
    if previous&lt;1:
    previous=1
    return render_template("home.html", persons=output, next=next, previous=previous)
</code></pre>

<p>Here, <code>request.args.get()</code> takes two parameters. Please explain why it takes two parameters and what is the use of it.</p>
