I am trying to send Get request to my server(Microsoft 2012). I have already added this solution. But in this is solution my get request transformed to Options method.
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/vnd.sas.datamgmt.jobflow.metadata+json; charset=utf-8',
'Authorization': 'Basic' + btoa('username:password')
})
};
I also added:
httpOptions.headers.set('username', 'password');
httpOptions.headers.append('Access-Control-Allow-Origin', '*');
httpOptions.headers.append('Access-Control-Allow-Credentials', 'true');
httpOptions.headers.append('Access-Control-Allow-Methods', 'GET,POST,OPTIONS');
this.typesOfDBs = this.http.get<Info[]>(this.ROOT_URL, httpOptions);
I watched my request and I saw the request is now Options request. How can I handle it and send request as Get method?