close

[Solved] IN Flutter Web getting ‘XMLHttpRequest’ error while making HTTP call

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error IN Flutter Web getting ‘XMLHttpRequest’ error while making HTTP call in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How IN Flutter Web getting ‘XMLHttpRequest’ error while making HTTP call Error Occurs?

Today I get the following error IN Flutter Web getting ‘XMLHttpRequest’ error while making HTTP call in php.

How To Solve IN Flutter Web getting ‘XMLHttpRequest’ error while making HTTP call Error ?

  1. How To Solve IN Flutter Web getting 'XMLHttpRequest' error while making HTTP call Error ?

    To Solve IN Flutter Web getting 'XMLHttpRequest' error while making HTTP call Error Just removed the header attribute from the post method and it works for me.

  2. IN Flutter Web getting 'XMLHttpRequest' error while making HTTP call

    To Solve IN Flutter Web getting 'XMLHttpRequest' error while making HTTP call Error Just removed the header attribute from the post method and it works for me.

Solution 1

  1. Fix the typo (replace underscores by dashes): header("Access-Control-Allow-Origin: *");
  2. Add the following header in your php code:header("Access-Control-Allow-Headers": "Access-Control-Allow-Origin, Accept");

Solution 2

Just removed the header attribute from the post method and it works for me.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment