-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XMLHttpRequest error #67
Comments
Have you tried making the request with the plain |
we ran into this XMLHttpRequest error when oauth token is expired. browser client is unable to capture http request 401 and return response. Instead, ClientException is thrown from http pacakge. |
@david-onehub-dev Same question: what happens when you make the request with a plain |
Hi, I'm still having this problem only when I use cross domain request. http.get('https://api.domain.com/non-exists-path'); This will throw a XMLHttpRequest error instead of return a Response object with status code 404. What I can do? |
This happens when I post to a URL. var client = new http.Client();
final _body = {
"grant_type": "password",
"username": _username.text,
"password": _password.text,
};
await updateLog(_body.toString(), duration: Duration(seconds: 2));
try {
final _data = await client.post(url, body: _body, headers: {
'Content-Type': 'application/x-www-form-urlencoded',
});
await updateLog(_data.toString(), duration: Duration(seconds: 2));
} catch (e) {
await updateLog('Post Error..', duration: Duration(seconds: 1));
await updateLog(e.toString(), duration: Duration(seconds: 1));
} returns |
This looks like a known limitation in the BrowserClient (seemingly based on a known limitation in XHR):
XHR's onerror is fired for network-level errors (i.e. where there is no HTTP response code). From a dev's perspective this is a generic network error caused by CORS, which needs to be fixed on the server side. As for this issue I'd say this is all WAI in the context of the limitations imposed by XHR and CORS. |
Gotcha. Yeah I have building Flutter apps for desktop and mobile and it’s just now when running the apps in the browser where it started breaking. Specifically logging in. So I am use firebase now as a proxy server |
I'm closing this issue since the original issue hasn't been updated since 2017 and the pings since then seem to be explained by #67 (comment) |
I need to test this in Browser ? Any Solution without hosting it in firebase ? |
Response code comes back null when using flutter web(browser), this is why this is happening. |
From @SadovovAlex on March 14, 2017 12:7
if response this format or other json:
{"listFias":[],"status":"NotFound"}
i recieved error:
XMLHttpRequest cannot load http://0001qwerty02:8888
Copied from original issue: dart-lang/sdk#29068
The text was updated successfully, but these errors were encountered: