Here is the code I am using to send a post request from Angular 6 to my web service.
const headers = new HttpHeaders({
'Content-Type': 'application/json' });
const headeroptions = { headers: headers };
return this.http.post(this.config.productsUrl + '?' + this.common.queryBuilder(options), {data: 'test'}, headeroptions);
The request shows results in the browser network panel, but it throws an error in the console:
Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.