I have problem when I call api for put and delete from swagger, error is: TypeError: Failed to fetch
Curl
curl -X DELETE "http://localhost:5000/api/Ad/2" -H "accept: application/json" -H "Authorization: Bearer MY_TOKEN"
From setup I had enable cors like this and put on begin of ConfigureService method:
services.AddCors(options => {
options.AddPolicy(
"AllowAll",
builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials()
);
});
thus from Configure before anything is put it
app.UseCors("AllowAll");
Why I'm not able to call delete method and put?
Reagrds, Danijel