I am facing an issue with my Angular 6 API. After creating interceptors, my POST requests are turning into OPTIONS requests.
What could be causing this problem?
Here is the code for one of the Services:
import { Injectable } from '@angular/core';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { AppConfig } from '../app.config';
import { Perfil } from '../Entities/Perfil';
@Injectable({
providedIn: 'root'
})
export class UsuariosService {
constructor(private http: HttpClient, private config: AppConfig) { }
private per = new Perfil(1);
getPerfiles() {
return this.http.post(this.config.apiUrl + 'perfiles/Buscar/', this.per);
}
}
Take a look at this image for further insight into the issue:
https://i.sstatic.net/x9p9r.png
Thank you!