title: How to check if a request is taking too long in requests?
body: <p>If I make a blocking request using <code>requests</code> to a remote api it takes too long then my site will return an error too.  I don't want that to happen.</p>
  
  <p>This is the blocking code I have:</p>
  
  <pre><code>@app.route('/api')
  def returnapi():
      r = requests.get("http://dndchecker.railsroot.com/api?mobile_number=9876543210")
      return r.text
  </code></pre>
  
  <p>I want to set the <code>r</code> value to False if the request object.</p>