https://pastebin.com/Uy9r8bEP I am trying to connect web api with flutter web and while it works in mobile it doesnt work in web. I have read and found out the reason is because of CORS. I tried enabling it from flutter and web API side (for web api im using asp.net core web api) and it didn't work. Then I tried disabling it from both sides. Still didnt work. This is the header I have
headers: {
'Content-Type': 'application/json',
"Access-Control-Allow-Origin": "*", // Required for CORS support to work
"Access-Control-Allow-Credentials": "true", // Required for cookies, authorization headers with HTTPS
"Access-Control-Allow-Headers": "Origin,Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,locale",
"Access-Control-Allow-Methods": "POST, OPTIONS"
},
Dart/Flutter: Http request raises XMLHttpRequest error I even added disable web security (made sure to add the comma too) but it still didn't work. Does anyone have any other suggestions as to how to make it work?
This is the header I have...where, exactly? It looks like a JSON object, not something which would be part of an asp.net application.