title: Cast Flask form value to int
body: <p>I have a form that posts a <code>personId</code> int to Flask. However, <code>request.form['personId']</code> returns a string. Why isn't Flask giving me an int?</p>
  
  <p>I tried casting it to an int, but the route below either returned a 400 or 500 error. How can I get I get the <code>personId</code> as an int in Flask?</p>
  
  <pre><code>@app.route('/getpersonbyid', methods = ['POST'])
  def getPersonById():
      personId = (int)(request.form['personId'])
      print personId
  </code></pre>