2

I have a piece of code that makes a post request to another website (minehut API)

    <script>
      fetch("https://api.minehut.com/users/login", {  
        mode: "no-cors",
        method: 'POST',  
        headers: {
          "content-type": "application/json"
        },  
         body: {
           "email":"no no no",
           "password": "no no no"
        }
      })
      .then(function (data) {  
        console.log('Request success: ', data);  
      })  
      .catch(function (error) {  
        console.log('Request failure: ', error);  
      });

however when i run it it returns net::ERR_ABORTED 500 and doesnt give a response.

How do i prevent it from showing this error and get a response.

0 Answers0