1

I'm using NodeJS in my application, I'm trying to call API service to get the token from the server. While I'm making any request from the NodeJS file I'm getting "ECONNRESET" error. I've tried with some API , which reflects the same error. Below is my code

import request = require('request');

request('https://postman-echo.com/get?foo1=bar1&foo2=bar2', (err,result,body){
 console.log(body);
});

The above is my code which I've tried with sample API. When I'm trying to run this code I'm getting

Error: read ECONNRESET 
       at TLSwrap.onstreamread( interal/stream_base_common.js:207:27 {
       error: -4077,
       code: ECONNRESET,
       syscall: read
}
ZachB
  • 13,051
  • 4
  • 61
  • 89
JeevaRekha
  • 383
  • 1
  • 7
  • 21

1 Answers1

0

Check if you have a proxy. This error occurs when not able connecting to the server.

Check your browser's proxy connection and Check your machine's proxy connection