Response Headers are Stripped From Response

Hi there guys, I am trying to make a call to the AppDynamics API to get a CSRF token. The CRSF token is sent through the Header of the Response but when the Response comes back the Headers, that would contain the CSRF token, seem to be stripped. Is there anything I can do to make it so that the Response Headers are not stripped?

As you can see the Response comes back with a 200 code but no Headers are within the Response.

This is an example of what the headers should look like using postman:

I have pasted my code that I use to call the API and log the Response to the console.

async getCRSFToken() {
    let token = '';
    if (this.clientName !== undefined && this.clientDomain !== undefined && this.clientSecret !== undefined) {
      let url = this.url + '/controller/auth?action=login';
      let auth = "username@customer1:password";
      let header = { 'Authorization': 'Basic ' + Buffer.from(auth).toString("base64")};
      const result = await getBackendSrv().datasourceRequest({
        url: url,
        method: 'GET',
        headers: header,
      });
      console.log(result)
      // token = result.data.access_token;
    }
    return token;
  }

Hi @ayarkhan you won’t be able to get the response headers in the frontend. The only way you can handle a case like this is implementing a backend datasource.

What kind of plugin are you implementing?

I have implemented a Front-end only Datasource plugin.

In that case there won’t be a way for you to access the headers from the backend request unless you implement the datasource using go.