18 Testing a REST API

 

This chapter covers

  • Creating a RESTful API to manage one or more entities
  • Testing a RESTful API

For now, let’s just say that if your API is re-defining the HTTP verbs or if it is assigning new meanings to HTTP status codes or making up its own status codes, it is not RESTful.

—George Reese, The REST API Design Handbook

Representational state transfer (REST) is a software architectural style for creating web services; it also provides a set of constraints. The American computer scientist Roy Fielding first defined REST, presenting the REST principles in his PhD dissertation in 2000. (Fielding is also one of the authors of the HTTP specification.) Web services following this REST architectural style are called RESTful web services. RESTful web services allow interoperability between the internet and computer systems. Requesting systems can access and manipulate web resources represented as text using a well-known set of stateless operations. We’ll study them in more detail in this chapter.

18.1  Introducing REST applications

18.2  Creating a RESTful API to manage one entity

18.3  Creating a RESTful API to manage two related entities

18.4  Testing the RESTful API

18.5  Summary

sitemap