Client errors versus server errors: unauthorized, forbidden, not found, internal server error, service unavailable and gateway timeout. Cut from the lesson "HTTP" in the CS50 Shorts courses. Source: CS50 Shorts, "HTTP" by CS50, Harvard University Original: https://cs50.harvard.edu/x/2024/shorts/http/ Licence: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/) Changes: Cut to about a minute, reformatted to vertical with a blurred background and re-encoded; captions, summary and thumbnail generated by Upgram. Not endorsed by CS50 or Harvard University. Shared under the same licence.
You’ll learn how HTTP status codes distinguish login-required errors (401), forbidden resources (403), missing files (404), and server failures (500). This helps you understand whether an access problem is due to your login, permissions, a missing page, or the server itself. A 403 means logging in won’t grant access; a 401 may be resolved by logging in.
Then you'll get things like client errors. So these are ones you've probably seen now. You probably haven't seen the 200s or the 300s, but you're probably familiar with the 400s, and that's what we'll talk about in a second, 500s as well. You might see 401 unauthorized. Usually, this means you're trying to access a page, but you haven't logged in. So you try and go to some profile or something on Facebook, or you try and access some, you're at work, you're trying to access something on your work's internet, but you're not logged in, you can't see the page. You might get a 401 unauthorized, which means we probably will be able to satisfy this request, but first, you need to log in to do so. Conversely, you might get 403 forbidden, which is, it doesn't really matter if you're logged in or not, this request isn't allowed. The resource exists on the server, but you are not allowed to access it. This is usually internal files that live on the server for various reasons, but are not intended to be accessed from the outside world, and so they are forbidden. They live there, I'm not saying I can't find it, but I'm saying I cannot give it to you, and it doesn't matter if you're logged in or not. And then, of course, the very common 404 not found, the file doesn't exist on the server, I would like to satisfy your request, but I can't. You'll also sometimes see server errors, the most common general one being 500 internal server error, which doesn't actually tell you anything at all about what has gone wrong. But it's not actually you making a mistake in your request, it's actually the server failing to deliver
Чтобы продолжить, установите приложение
Ставьте «Нравится», комментируйте, подписывайтесь на авторов и следите за прогрессом в приложении Upgram.
Скачать Upgram
Комментарии