Access to XMLHttpRequest at has been blocked by CORS policy in my flutter web app

211 views Asked by At

I am using the Stellar networks flutter Sdk and I'm trying to load a toml file from a domain at "https://soneso.com/.well-known/stellar.toml"

but I keep getting this error "Access to XMLHttpRequest at 'https://soneso.com/.well-known/stellar.toml' from origin 'http://localhost:55821' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource"

this is my code below

InkWell(
        onTap:
        () {

            check() async {

                stellar.StellarToml stellarToml = await stellar.StellarToml.fromDomain("soneso.com");
                stellar.GeneralInformation generalInformation = stellarToml.generalInformation;
                print(generalInformation);
            }


            html.window.open("https://www.w3schools.com", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=${MediaQuery.of(context).size.height * 40 / 100},left=,width=400,height=700");
            check();


        },     

                                         },
0

There are 0 answers