ubazival roohi
ubazival roohi

Reputation: 1

Streamlit requests.post() raises ConnectionError 10054 - Connection Reset by Peer in Flask API

I am working on a Streamlit frontend that communicates with a Flask backend running locally. The goal is to send a POST request from Streamlit to Flask using requests.post(), but I keep getting the following ConnectionError:

python

CopyEdit

ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))


System Information:


What I Expected to Happen


What Actually Happens

I am working on a Streamlit frontend that communicates with a Flask backend running locally. My goal was to send a POST request from Streamlit to Flask using requests.post().

What I Tried

  1. Started Flask Backend (app.py)

    bash
    

    python app.py

    • Flask started successfully and showed:

      csharp
      

      CopyEdit

      * Running on http://127.0.0.1:5000

  2. Ran Streamlit Frontend (frontend.py)

    bash
    

    CopyEdit

    streamlit run frontend.py

    • The UI loaded correctly, but when I clicked "Generate Plan", I received an error.

What I Expected

What Actually Happened

Questions

Upvotes: 0

Views: 16

Answers (0)

Related Questions