Page 1 of 1

Flutter -SocketException: OS -Fehler: Keine Route zu Host, Errno = 113, Adresse = xxxx, port = 42376

Posted: 12 Mar 2025, 11:09
by Anonymous
Ich habe diesen Fehler erhalten.final String basicAuth = 'Basic ' + base64Encode(utf8.encode('$authUsername:$authPassword'));
final String _grantType = "password";

http.Response response = await http.post(
Uri.encodeFull("this is my url api"),
headers: {
"authorization": basicAuth,
'content-type': 'application/x-www-form-urlencoded',
},
body: {
"username": username,
"password": password,
"grant_type": _grantType,
},
);
< /code>
Ich habe die URL mit Postman ausprobiert und perfekt arbeitet. Habe ich sie richtig geschrieben? Ich bin mir nicht sicher, ob ich die Autorisierung grundlegender Auth -Code platzieren kann.