# CORS Policy

Rules for which other websites may call your API from a browser.

## What is **CORS Policy**?

A **CORS policy** says which other websites may call your API from the browser, with which methods and headers.

```csharp
builder.Services.AddCors(o => o.AddDefaultPolicy(p =>
    p.WithOrigins("https://www.example.com").AllowAnyHeader().AllowAnyMethod()));
...
app.UseCors();
```

Level: Journeyman · [More ASP.NET Core terms at this level](https://www.ask-codey.com/glossary?category=aspnet-core&level=3)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/cors-policy
