title: Calling self-made Python API with another Python program
body: <p>I'm running a local server with my Flask Python program. I am able to GET request the server with curl:</p>
  
  <pre><code>curl http://localhost:5000/ -d "input_data=something" -X GET
  </code></pre>
  
  <p>and everything goes well.
  However, if I try to call it from another Python program this way:</p>
  
  <pre><code>import requests
  r=requests.get('http://localhost:5000', json={"input_data": "something"})
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: / (Caused by NewConnectionError('&lt;requests.packages.urllib3.connection.HTTPConnection object at 0x7fe3b510a310&gt;: Failed to establish a new connection: [Errno 111] Connection refused',))
  </code></pre>
  
  <p>What is the problem here?</p>
  
  <p>Besides, is there a way to insert the server program into a standard Linux pipeline? I mean something along this logic (of course, I know that this concretely doesn't work):</p>
  
  <pre><code>cat "something" | http://localhost:5000 &gt; output
  </code></pre>