In this video, we will review the best practices for handling errors within our restful API.
- [Teacher] Hi, and welcome…to the third video of section four.…Error Handling in RESTful APIs.…In the previous video we learned caching mechanisms…and how to speed up our API using different caching methods.…In this video, we are going to take a look at HTTP…response and error code, when to use which error code.…After that, we will cover how to add to response subject…our custom HTTP error codes and how to input error…messages in the response headers.…At the end, we will review the source code…of our API which covers all these.…
In this table we can see the most common…HTTP response codes.…Some are error codes and some are not.…When implementing a RESTful API we need…to carefully plan the request and response…round-trips and be consistent with HTTP response codes.…For example, if our API cannot handle…all the request parameters,…we can return HTTP 400 Bad Request,…but we can also return HTTP 500 Internal Server Error,…depending on the use case.…It is good to have consistent and predictable…response for these kind of situations,…
Regardless of platform, you will need to build APIs to serve data between different client applications and endpoints. Good APIs are a necessity for web and mobile projects, especially with the modern, mobile-first approach to development. This course delivers the fundamental knowledge required to enable highly connected interactions between applications via RESTful web APIs. Follow along with Gergo Bogdan and learn how to build up and structure an effective web API that can be used by any client application accessing it over HTTP, using Flask, the Python microframework.
Find out how to implement CRUD operations using SQLAlchemy and MySQL as the data store. Get an understanding of how REST works relative to APIs, and learn how to test APIs written in Python with the support of Flask. Explore token-based authentication and find out how to store passwords securely in your database. Along the way, Gergo introduces best practices and design guidelines when building large applications.
- Setting up Flask
- Using Flask templates and routing
- Implementing CRUD operations
- Implementing pagination
- Configuring RESTful authentication
- HTTP caching
- Securing web APIs
- Testing the application