how to set the cors?

mc 5,511 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?

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,086 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.