0PricingLogin
Flask Academy · Lesson

Query Strings via request.args

Read URL parameters after the question mark.

What Is a Query String

A query string is the part of a URL after the question mark, like ?q=cats&page=2. It carries small bits of optional input. 🔎

Where request Comes From

Flask gives you a global request object that holds everything about the incoming call. Import it once and reach for it inside any view.

from flask import request

All lessons in this course

  1. Query Strings via request.args
  2. Form Fields via request.form
  3. JSON Bodies via request.get_json
  4. Headers, Cookies, and the Client IP
← Back to Flask Academy