
Hello, if I run a http request on the web I alway get a xmlhttprequest error, does anybody know how to fix that issue?
code:
TypeScript
Future<bool> checkName(String name) async {
const apiUrl = 'https://...';
try {
final response = await http.get(Uri.parse(apiUrl));
if (response.statusCode == 200) {
final Map<String, dynamic> data = json.decode(response.body);
// Überprüfe, ob 'names' in den Daten vorhanden ist
if (data.containsKey('names')) {
return data['names'].contains(name);
} else {
throw Exception('Ungültiges Format der API-Antwort: \'names\' nicht gefunden.');
}
} else {
throw Exception('Fehler bei der API-Anfrage: ${response.statusCode}');
}
} catch (e) {
print('Fehler: $e');
return false;
}
}```
I know that I am here on the appwrite discord, but I could find help on the internet and other servers.
TL;DR
Developers are experiencing an xmlhttprequest error in Flutter's HTTP package. There is a suggestion to use the SDK for Flutter to handle sessions. One developer is facing an issue with a http request on the web. A code snippet for a function called 'checkName' is provided, where the error occurs.
Solution: The developer can try using Flutter's SDK for better session handling.
You're doing requests with the API?

I suggest using the SDK for flutter since it will handle sessions, etc.
Anyways, what are the requests that you're performing?
Recommended threads
- Hello all, does anyone know if it is po...
I'm looking for information on how to migrate to here from Mocha, while retaining my ties with stripe and react. Any Ideas ?
- Hi, I am trying to deploy a function fro...
2025-08-08T10:57:38.692443793Z Compiling ... 2025-08-08T10:57:39.652983250Z src/server.dart:6:8: Error: Error when reading '../build/lib/main.dart': No such fil...
- Adding Appwrite MCP server to vscode. Ne...
I'm trying to add appwrite mcp server to my VS code. Online documentation is for cusror, windsurf and Claude. Is it possible to use mcp tools in vscode for appw...
