To fix the crash of cors in api laravel I used the package Laravel Cors and followed everything I was informed in , but now it is returning an error when executing a request http
post
Error:
POST link 419 (unknown status)
Controller
for request:
public function store(Request $request)
{
$palestras_divulgacao = new palestras_divulgacao;
$palestras_divulgacao->fill($request->all());
$palestras_divulgacao->save();
return response()
->json($palestras_divulgacao, 201);
}
Calling http
post
Angular on the client side:
public registrarPalestra(p: palestras): Observable<number> {
let headers: Headers = new Headers()
headers.append('Content-type', 'aplication\json')
return this.http.post(
'${URL_API}palestra',
JSON.stringify(p),
new RequestOptions({headers: headers})
).pipe(map(response => response.json().id));
}