I have an application in Angular 4 that consumes a service in ASP .Net Core and there is no problem. This same application also consumes data from another service but this is in ASP .Net is a REST API,
This is the code of my Service
[HttpGet]
[Route("api/Documentos/getString")]
public string getString()
{
return "ok";
}
and that's how I'm consuming it from Angular
constructor(private httpClient: HttpClient) {
this.header = { headers: new HttpHeaders({ 'Content-Type': 'application/json' })};
}
getString(): Observable<any> {
return this.httpClient.get("http://localhost:60402/api/Documentos/getString", this.header);
}
The error you give me is the following.
Maybe I need to add something in the webConfig but I really do not know, any solution?