title: How to send http request to python flask server from desktop application?
body: <p>I have configured python server using flask framework.
  Now I want to send request to server from my desktop application.
  My server location is : <code>http://127.0.0.1:5000/</code></p>
  
  <p>I have written code which work from browser but i want to access that code from my desktop app.</p>
  
  <pre class="lang-python prettyprint-override"><code>import flask,flask.views import os import functools 
  app=flask.Flask(__name__)
  
  app.secret_key="xyz" users={'pravin':'abc'}
  class Main(flask.views.MethodView):
      def get(self):
          return flask.render_template('index.html')
      def post(self):
          if 'logout' in flask.request.form:
              flask.session.pop('username',None)
              return flask.redirect(flask.url_for('index'))
          required=['username','passwd']
          for r in required:
          if r not in flask.request.form:
              flask.flash("Error: {0} is required.".format(r))
              return flask.redirect(flask.url_for('index'))
  
          username=flask.request.form['username']
          password=flask.request.form['passwd']
          if username in users and users[username]==password:
              flask.session['username']=username
          else:
              flask.flash("Username doesn`t exist or incorrect password.")
  
          return flask.redirect(flask.url_for('index'))
  
  app.add_url_rule("/",view_func=Main.as_view("index"),methods=["GET","POST"])
  app.debug=True
  app.run()
  </code></pre>