Re:Browsers barely care what HTTP status code your web pages...
by notRobot on Friday August 11, 2023 @09:32AM
(#37088517)
For anyone interested, here's a bookmarklet to view the current page's HTTP status code (makes a new request):
[ Parent
| on HN ]
Re:Browsers barely care what HTTP status code your web pages...
by dtgriscom on Friday August 11, 2023 @11:07AM
(#37089543)
For suspicious types (including me):
javascript:(function(){javascript:(function() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
alert('HTTP Status Code: ' + xhr.status);
}
};
xhr.open('GET', window.location.href, true);
xhr.send();
})();})();
Re:Browsers barely care what HTTP status code your web pages...
by sopooneo on Friday August 11, 2023 @05:18PM
(#37094160)
And to recurse on more level: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequ...
Re:Browsers barely care what HTTP status code your web pages...
by recursive on Friday August 11, 2023 @02:09PM
(#37091874)
This assumes a GET.
Re:Browsers barely care what HTTP status code your web pages...
by mike503 on Saturday August 12, 2023 @02:04AM
(#37097461)
Also firing a second request would break restful behavior and could wind up really messing stuff up worse. Maybe it places an order twice? Who knows. Not a good idea.
Re:Browsers barely care what HTTP status code your web pages...
by notRobot on Saturday August 12, 2023 @01:41PM
(#37102491)
If reloading a page (which is what this is identical to) breaks your website, that's not on the user.
Re:Browsers barely care what HTTP status code your web pages...
by notRobot on Saturday August 12, 2023 @05:30PM
(#37104407)
GET requests are not supposed to modify server state.
https://stackoverflow.com/questions/45016234/what-is-idempot...