KnowledgeCity

Error Handling and Testing REST APIs

Learn how to deal with REST API errors and create and run automated tests
Preview the first lesson free — get full access to all 3 lessons.

To view this video please enable JavaScript.

Course: On-Demand
Beginner  Provider Josh Guardino  3 Lessons ·  17m  in Arabic, German, English, Spanish, French, Portuguese, Chinese Simplified 

Course Description

APIs are, by their nature, distributed software applications that consist of remote clients and servers connecting over a network. While remoting has changed the world as we know it, it also brings an enormous list of potential pitfalls and problems. Servers and networks go down. Computers can act in unexpected ways. Clients change and cannot process requests and responses. All of these add up to one constant truth: the only known factor is the unknown.

To handle the unexpected, it is important for RESTful clients and servers to deal with these conditions gracefully. In these lessons, you will learn how errors occur on both sides and how the combination of error details, status codes, and messages can be processed in an optimal manner.

The best defense against instability and inconsistency with software is to test it consistently and regularly. We’ll show you how to use TestProject, a free web-based tool, to script and automate REST API tests to discover and identify error conditions and provide useful information for debugging and performance tuning.

What You'll Learn

  • Identify the most common types of REST API errors and their corresponding status codes
  • Recognize how errors occur on both the client and server sides of an API
  • Process error details, status codes, and messages in an optimal manner to handle the unexpected gracefully
  • Configure and run TestProject to script and automate REST API tests for GET requests
  • Configure and run TestProject for POST, PUT, PATCH, and other write requests
  • Use automated REST API testing to discover error conditions and provide information for debugging and performance tuning

Key Takeaways

  • APIs are distributed applications of remote clients and servers connecting over a network, which introduces many potential pitfalls such as servers and networks going down or clients failing to process requests and responses.
  • RESTful clients and servers should deal with unexpected conditions gracefully by combining error details, status codes, and messages and processing them in an optimal manner.
  • Consistent and regular testing is the best defense against software instability and inconsistency.
  • TestProject is a free web-based tool used to script and automate REST API tests to identify error conditions and support debugging and performance tuning.
  • The course covers handling both GET requests and write requests such as POST, PUT, and PATCH.

Frequently Asked Questions

What does this course cover?

It covers how errors occur on both the client and server sides of REST APIs, how error details, status codes, and messages can be processed optimally, and how to use TestProject to script and automate REST API tests for discovering error conditions and supporting debugging and performance tuning.

What testing tool is used in this course?

The course uses TestProject, a free web-based tool, to script and automate REST API tests.

What types of API requests does the course teach you to test?

It teaches configuring and running TestProject for GET requests as well as for POST, PUT, PATCH, and other write requests.

What skills does this course help build?

It addresses skills including API Design, API Management, API Testing, REST API Development, REST Client, and RESTful API.

What lessons are included in this course?

The course includes three lessons: REST API Error Handling and Testing; HTTP GET Methods; and POST, PUT, and PATCH Requests.