"XMLHttpRequest error."

I’m new to flutter development
I am creating an API with laravel in order to connect to my database to retrieve the data.
But I’m not narrating how to get the data
But in postman it works very well. Do I have to configure before it works?
Please help me

I have only one exception
“XMLHttpRequest error.” that I don’t understand.

i need your help

When I compile my project it sends me to the browser_client.dart file at line 90
return await completer.future;

Hello and welcome.
Have you given your app permissions to access the network?


"In order to perform network operations in your application, your manifest must include the following permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

[…] "


Provide appropriate header on http request

for xml
final response = await http.post(url,
headers: {‘Content-Type’: ‘text/xml; charset=utf-8’},
body: utf8.encode(body));

1 Like

@ElrPeter Pls Confirm if worked so it will be helpful for other community members.

this is not working for me >>>> I have tried every solution and still have a problem.

People should enable CORS from there API provider … I solved the problem by doing this… search about how to enable them using the programing language that you are using to host the API

1 Like