Hello,
I'm trying to use the REST API JIRA to catch informations about my installed plugins. To do that, I created an Angular 6 project and I used HttpClient to do an GET request wich I pass my basic authorization in the header.
I got an Preflight cors error..
app.component.ts
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Authorization': 'Basic ' + btoa('xxx:xxx')
})
};
this.httpService.getHttp('https://jira.mydomain.com/rest/plugins/1.0/', httpOptions)
.subscribe(jsonPlugins => {
this.filterPlugins(jsonPlugins);
this.setPluginsLastestVersion();
});http.service.ts
getHttp(url: string, httpOptions: {}) {
return this.http.get(url, httpOptions);
} I'm completly lost. If someone could help me
Have a good day, thanks