Home javascript Network Error when requesting a server via AXIOS

Network Error when requesting a server via AXIOS

Author

Date

Category

Customer request code, I test on LAN (connect to localhost: 4000):

export const senddata = data = & gt; (dispatch) = & gt; {
 Dispatch (SendDataRequest ());
 const url = routes.syncurl ();
 axios.post (URL, DATA)
  .then ((Response) = & gt; {
   Console.log (Response);
   Dispatch ({ResponseLink: Response.Data}));
  })
  .catch ((ERR) = & gt; {
   Console.log (ERR);
   Dispatch (SendDataFailure ({ResponseError: 'errore del Request'}));
  });
}; 

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions