-1

Getting the following error.

ERROR Message

One possible reason I see is that the data sent is not a pure HTML but I couldn't find how to send (or what exactly is) a pure HTML to be sent in POST request

This is the code I'm using :

axios.post(
        "https://cors-anywhere.herokuapp.com/http://ec2-13-231-224-159.ap-northeast-1.compute.amazonaws.com:8080/api/invoice/pdf/generate"
      , this.state.stuff)
      .then((res) => {
        console.log(res);
      });
    console.log(this.state);

There is no server side to contact so I relied on CORS Proxy

bhav_yea
  • 63
  • 6

1 Answers1

-2

In order to allow making CORS requests, the API response should contain the valid CORS headers. At least Access-Control-Allow-Origin with the URL of your client as the value. You can also use * as the header value for development purposes only (don't do so in a production app).

You can read more about CORS in this MDN article