Responded with a status of 401

I am getting this error when calling and I have to clue how to fix it

postData () {

    var headers = new HttpHeaders();
    headers = headers.set('Authorization','xxxxxxxxxxxxx');
    headers = headers.set('Content-Type','application/xxxxxxxxxx');
    headers = headers.set("Access-Control-Allow-Origin", "http://localhost:");
    headers = headers.set("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
    headers = headers.set("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization, Origin, Accept");

    // let requestOptions = {
    //   headers: new HttpHeaders()
    //  };
    // requestOptions.headers = headers;

    let body = {

    console.log(headers),qs.stringify(body), {headers : headers} )

Well I think you have to take a look at the server side.

The Server don’t let you on the requested url.

So the authorization goes wrong or the routing to the url is wrong.

Now you know where to look.

The headers will have to be configured on the server. You will need to make sure OPTIONS is also included with the other verbs.