-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Define XMLHttpRequest failure #32447
Conversation
Preview URLs (comment last updated: 2024-02-29 19:38:25) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me like null
is never the value. I don't see a path here where null
is returned.
And this code:
const xhr = new XMLHttpRequest();
xhr.open("GET", "https://httpbin.org/status/503");
// If specified, responseType must be empty string or "text"
xhr.responseType = "text";
xhr.onloadend = () => {
console.log(xhr.status);
console.log(xhr.responseText);
};
xhr.send();
...gives me:
503
<empty string>
You're absolutely correct, I'll remove the whole statement "or |
Co-authored-by: wbamberg <will@bootbonnet.ca>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thank you @JayAgra !
Description
Attempting to resolve #31129 by specifying a failed request is a non-2XX response code.
Motivation
Just looking to clarify the confusion found by @maxpblum
Additional details
MDN response code docs https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
Related issues and pull requests
Fixes #31129