Error: connect ECONNREFUSED 127.0.0.1:5000

Hello Postman community! I am new to postman and am currently just trying to follow along with an online tutorial setup to eventually make a small ai image generator app.

Specifically, the problem is that the post request I am trying to make is coming back with the error ‘Error: connect ECONNREFUSED 127.0.0.1:5000’. I am trying to make a post request that will return an object {success: true} that I have written in my application.

Currently I have tried:
Checking for a firewall issue. I temporarily disabled it whilst trying to make the post request it in case that was causing the issue.

I also ran npm run dev in this app and it shows up as having connceted.

I even ran npm run dev in a separate app of mine to test that local host was not being blocked in my browser, but that app showed up fine as normal.

Please see the screenshots below for details of the setup (first two pictures) and the post request itself(third picture) for this post request:



1 Like

Solved! I simply had to make sure I was actually running the server before making the post request…

2 Likes

I am having the same issue with POSTMAN. It’s a Java application, and everything was working fine until I added spring boot security configuration. All of a sudden, I am getting the ECONNREFUSED error. However, it only occurs when I run the eclipse ide in debug mode. If I stops and runs it in normal mode, the requests are working as expected.

and how would u check if the server is running or not, I am new to this stuff

Run the python script containing your API code. Then run postman again. This worked for me.