0PricingLogin
Flask Academy · Lesson

Form Fields via request.form

Pull values from submitted HTML forms.

Forms Send Data in the Body

When an HTML form posts, the field values travel inside the request body, not the URL, so request.args will not find them.

Meet request.form

For posted form fields Flask gives you request.form, a dict-like object keyed by each input name on the page.

name = request.form["name"]

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