how to set the cors?

mc 4,111 Reputation points
2023-06-05T05:56:23.7466667+00:00
builder.Services.AddCors(options =>
{
    options.AddDefaultPolicy(builder =>
    {
    builder.WithOrigins("").AllowAnyHeader().AllowAnyMethod().AllowCredentials();
    });
});

I am using a android app

how to set the orgin? there is no origin of mine?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,396 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,491 Reputation points
    2023-06-05T21:10:14.8733333+00:00

    unless you are using a javascript ajax in a webview, android apps do not use CORS. you can configure the webview to ignore CORS for file based urls.

    0 comments No comments