'Postman connect ECONNREFUSED 127.0.0.1:8080

Trying to test an API endpoint and got this error. Could it be my request body? Or is it a network issue? Maybe something I need to change in my proxy settings?

POST http://localhost:8080/v1/collections
Error: connect ECONNREFUSED 127.0.0.1:8080
Proxy
authenticate: false
disabled: false
host: "127.0.0.1"
id: "smth"
match: {…}
port: 8080
tunnel: false
Request Headers
Test: check-headers
x-ads-token-data: {stuff}
x-ads-gateway-secret: test1
Content-Type: application/json
User-Agent: PostmanRuntime/7.26.5
Accept: */*
Postman-Token: xxxx
Host: localhost:8080
Accept-Encoding: gzip, deflate, br
Connection: keep-alive


Solution 1:[1]

econnrefused means most probably you have not started your server on port 8080.

Take a look at the nodejs documentation here

ECONNREFUSED (Connection refused): No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host.

Solution 2:[2]

I am new to doing REST API and was trying to do Post request. I got this error when I was using Postman and c#

POST https://localhost:44310/api/Books
Error: connect ECONNREFUSED 127.0.0.1:44310
Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.28.4
Accept: */*
Host: localhost:44310
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Request Body
{
    "Id": 1,
    "Title": "Harry Potter",
    "Author": "J.K. Rowling",
    "Pages": 500
}

what happened was that the program was not running in visual studio but after executing it, the error did not appear again.

Solution 3:[3]

Hope my response will be useful. I got the same issue and looks like clearing the breakpoints and setting the same again fixed the issue.

Solution 4:[4]

I had the same problem and solved it by defining the "Edit / run configuration dialog" in IntelliJenter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rags2riches-prog
Solution 2 Jonier Pachon
Solution 3 Srikumar Krishna Iyer
Solution 4 5ar