From the course: Building RESTful APIs with Flask
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
HTTP status codes
- [Instructor] The web is based on a request-response mechanism. Your browser requests a resource from a site and the site returns a response. Typically, it's an HTML document with links, descript files, CSS images, videos, and whatever else is needed to render the page. But there's more to the response than just the HTML or the JSON data that you can see. Requests and responses both have headers. Headers are metadata that describe the characteristics of the request or response. One of the key pieces of information in the header is the status code. Status codes in HTTP will tell you whether or not your request was actually successful or not. Most of the time it is and the status code shows as 200 as we saw in Postman. The valid status codes are defined in the HTTP specification. And it's an easy thing to Google the status codes to find out what they are. In our earlier example, the response defaulted to a code of 200 okay. Status codes are useful because if I have a UI that's calling…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.