I am using following code to send a post request
import { Http, Headers, Response } from '@angular/http';
@Injectable()
export class AuthenticationService {
private _options = new Headers({'Content-Type': 'application/json'});
constructor(private http: Http) { }
login(username: string, password: string) {
return this.http.post('http://localhost:56451/map',
{ "username": username, "password": password },
this._options);
}
}
however I am getting following error in vscode
Argument of type '{ headers: HttpHeaders; }' is not assignable to parameter of type 'RequestOptionsArgs'. Types
of property 'headers' are incompatible. Type 'HttpHeaders' is not assignable to type 'Headers'. Property 'forEach'
is missing in type 'HttpHeaders'.
Please help clarify associated concepts