Search code examples
flutterasp.net-coreflutter-web

web api post method do not work in flutter


I did everything which i found in internet, but still its not working...

The web api is .net core 5

http.Response response = await http.post(
        Uri.parse(ss),
        headers:
        {
          "Access_Control_Allow_Methods": "POST, OPTIONS",
          "Content-Type": "application/json",
          "Access-Control-Allow-Origin": "*",
          "Access-Control-Allow-Credentials": 'true'
        },
        body: _buyBasket
    );

Solution

  • you must change your API .net core to .net core 6.0 to resolve your problem happy code