Error while post request


#1

getPerformance(username:string)
{
let body = new FormData();
body.append(‘username’,username);

var result;
if(result)
{
	Promise.resolve(result);
}

return new Promise(resolve=>{
this.http.post(“http://www.example.in/example/example.php”,body).subscribe(data=>{

       result = data;
       resolve(result);

    },error=>{
       
       result = error;
       resolve(result);
    });
});

}

The above is my code trying make a post request to the server
But many times im getting net::ERR_CONNECTION_RESET error and sometimes it is working if we make request many why is that somebody help me


#2

please anyone help me