I was trying to build application outside the Splunk web interface using Splunk REST APIs and Angular 6 I Got**CORS rejection error
REST API ( I used 😞 https://localhost:8089/services/auth/login
result:
*angular Code : *
login(data) {
const body = new URLSearchParams();
body.set('username', data.username);
body.set('password', data.password);
body.set('output_mode', 'json');
const options = {
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
};
console.log(body.toString());
this.http.post('https://localhost:8089/services/auth/login', body.toString(), options).subscribe(
(resData) => {
console.log(resData);
},
(err) => {
console.log(err);
}
);
console.log(data);
}
but it is working fine with Post man
Then I tried Changing server.conf
... View more