From the course: Cisco DevNet Associate (200-901) Cert Prep 2: Understanding and Using APIs

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

REST and RPC comparison

REST and RPC comparison

- [Instructor] We have been discussing REST for API, which is by far the most common style of API for the last few years. When somebody wants to build or consume an API over HTTP nowadays, we could pretty much safely assume they are talking about a REST API. However, there are other alternative styles of API available, mainly RPC, or remote procedure call. It could be XML-RPC, SOAP-RPC, or JSON-RPC. Both REST and RPC has advantages and disadvantages. In this section, we will discuss the differences between RPC style and REST style APIs. Let's begin by quickly recapture the characteristics of REST. It is in a decouple client-server relationship. They are stateless, no persisting sessions on the web server. Responses should be declared to be cacheable if applicable. They have uniformity with similar structure and endpoints. The RPC API is essentially the same as calling a function remotely. It takes a method name and…

Contents