title: Unable to request the status code of localhost
body: <p>I am using python and flask to create a web API. However I am getting trouble in requesting the HTTP status code of my localhost.</p>
  
  <p>My code:</p>
  
  <pre><code>import requests
  import flask
  
  app = flask.Flask(__name__)
  app.config["DEBUG"] = True
  
  @app.route('/home', methods=['GET'])
  def home():
      r = requests.get(url="http://localhost:5000/home")
      print(r.status_code)
  
      return "Welcome!"
  
  app.run()
  </code></pre>
  
  <p>Before adding the line for requesting status code, it works fine in my browser (Chrome) and the command prompt show something like this:</p>
  
  <p><code>127.0.0.1 - - [19/Sep/2019 01:03:54] "GET /home HTTP/1.1" 200 -</code></p>
  
  <p>After adding the line for requesting, it keeps loading (forever) in my browser and no response in the command prompt.</p>
  
  <p>I have no idea about this problem because it did not show any error and I have read some of the solutions mentioned in other similar problems (like disabling proxy) but it seems not working for me.</p>
  
  <p>Thanks!</p>