Front: headers: { 'Content-Type': 'application/json', 'Accept': '*/*', 'Authorization' : '', 'Origin': 'http://localhost:3000', 'Mode': 'cors' }, Back: builder.Services.AddPersistence(builder.Configuration); var MyAllowSpecificOrigins = "_myAllowSpecificOrigins"; builder.Services.AddCors(options => { options.AddPolicy(MyAllowSpecificOrigins, policy => { //mettre le front policy.WithOrigins("http://localhost:3000") .AllowAnyHeader() .AllowAnyMethod(); }); });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter