ECONNREFUSED error when calling local server

connect ECONNREFUSED 127.0.0.1:8000

Request Headers

Content-Type: application/json
User-Agent: PostmanRuntime/7.33.0
Accept: */*
Postman-Token: 6786f4a7-1bfe-463b-bca4-d61a35b36ca1
Host: localhost:8000
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

Request Body

{
    "name":"neha",
    "email":"test@test.com",
    "password":"123456789",
    "phone no":"987654321",
    "address":"mumbai India"    
}

Hey @docking-module-eng11 :wave:

Welcome to the Postman community! :postman:

What trouble shooting have you done so far? Is the local server running? Does that have any console logs?

Is there any more information/images that you could share with up to help bring the information to life?

Here’s guide from our support pages which relate to an ECONNREFUSED error:

POST http://localhost:8000/api/v1/auth/register

Error: connect ECONNREFUSED 127.0.0.1:8000

:arrow_forward:Request Headers

Content-Type: application/json

User-Agent: PostmanRuntime/7.33.0

Accept: /

Postman-Token: 304c9b17-7e02-4e2b-b0a7-8f70a183be27

Host: localhost:8000

Accept-Encoding: gzip, deflate, br

Connection: keep-alive
this is what i am getting in my console log

I meant the console log/terminal of your local server, where ever it is running.

Are you in control of this server?

Is the port number your using clashing with anything else?

Could that be changed to a different number?

Do you have any more details about the implementation of that API?

How do you know that it requires that request payload?

Are there any documents available to share?

You also might want to check http vs https as that is a common cause for the connection to be refused.

8000 is not a standard port, so if you are on Windows, you might want to check your local firewall as well.

http://localhost:8080/api/v1/auth/register
now i am using this url and its giving me 404 Not found error

yes my server is running
how will i check that port number is clashing?
I am sending you my register api code


If you are getting a 404 not found, it means that the server is responding but it can’t find the resource. (So the ports should be ok).

I’m not a developer, so I can’t really help with the API code.

Although, the path you show is api/v1/auth/register (and I can’t see mention of the other path elements in your routing code).

You might be better posting this question on a JavaScript developer forum or Stack Overflow.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.