title: Curl localhost connection refused
body: <p>I am trying to run this command in git bash:</p>
  <pre class="lang-sh prettyprint-override"><code>curl http://127.0.0.1:8000/
  </code></pre>
  <p>or</p>
  <pre class="lang-sh prettyprint-override"><code>curl localhost:8000/
  </code></pre>
  <p>but I receive this error:</p>
  <pre><code>curl: (7) Failed to connect to 127.0.0.1 port 8000 after 2043 ms: Connection refused
  </code></pre>
  <p>tried to npx kill-port 8000 but it didn't solve the issue.
  when I use the following command, it works without issue on the same port of  <a href="http://127.0.0.1:8000" rel="nofollow noreferrer">http://127.0.0.1:8000</a>:</p>
  <pre class="lang-sh prettyprint-override"><code>python -m uvicorn main:app
  </code></pre>
  <p>unfortunately, I need to have this with curl command.</p>