Response for preflight does not have HTTP ok status. Angular REST API 5

0

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?

    
asked by Hersenfels 20.10.2018 в 00:29
source

0 answers