private handleError (error: any) {
// In some advance version we can include a remote logging of errors
let errMsg = (error.message) ? error.message :
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
console.error(errMsg); // Right now we are logging to console itself
return Observable.throw(errMsg);
}
startCrawlJob(crawlvalues,username,password) {
let headers = new Headers({ 'Accept': 'application/json' });
headers.append('Authorization', 'Basic ' +
btoa(username+':'+password));
let options = new RequestOptions({ headers: headers });
return this.http
.post('http://localhost:8090/Crawler_p.html',crawlvalues, options).map(res =>
res.json()
).catch(this.handleError);
}
I am trying to send headers with my post request but I am unable to find any headers in my request. where could be a mistake in the above code.
below is the attached request in chrome.

