title: How too send and receive http POST requests in Python using Apache server
body: <p>I need a simple Client side that can send a bool valu if he is Alive, in a HTTP POST request.  I have a Linux server running Apache.</p>
  
  <p>I realized from Atermi(user who helped me), i new to use a requests library, something like this:
  import requests</p>
  
  <pre><code>r = requests.post("http://127.0.0.1/post", data={'key': 'val'})
  print(r.text)
  </code></pre>
  
  <p>But I don't know how to make my apache server receive the post requests.</p>
  
  <p>In addition,when running the script I am receiving an error, </p>
  
  <blockquote>
    <p>The requested URL '/' was not found on this servers.</p>
  </blockquote>
  
  <p>I tried a server side, for testing in the same linux server and this is the 
  Code, </p>
  
  <pre><code> from flask import Flask, request
   app  = Flask(__name__)
   @app.route('/', methods=['POST'])
   def res():
       print(request.form['key'])
       return "Revived"
  </code></pre>
  
  <p>but recveing the following error:
  runtimerror: working outside of the request context</p>
  
  <p>Thanks!</p>