300-435 Question 14
Select 3A team is designing an automation solution to interact with a Cisco enterprise network. They are evaluating the use of REST and RPC API styles for their solution. Which characteristics of REST and RPC should they consider when making their decision?
- A
REST APIs are stateless and rely on standard HTTP methods such as GET, POST, PUT, and DELETE.
- B
RPC APIs are typically designed to use JSON or XML payloads to define resources and actions.
- C
REST APIs are focused on resource-based interactions, where operations are performed on resource representations identified by URIs.
- D
RPC APIs focus on invoking remote procedures or methods, often resembling function calls in programming.
- E
RPC APIs enforce a strict resource-based structure for interactions, requiring the use of URIs for resource identification.
Show answer and explanation
Correct answers: A, C, D
Explanation
REST and RPC APIs differ significantly in their design principles and use cases. REST is resource-based and stateless, using standard HTTP methods and URIs to interact with resources. In contrast, RPC focuses on invoking remote functions or methods, often resembling function calls in programming. Understanding these distinctions is critical for selecting the appropriate API style for a given automation solution.
- A. Correct.
REST APIs are stateless and rely on standard HTTP methods, which is one of their defining characteristics. This makes them ideal for scalable, loosely-coupled architectures.
- B. Incorrect.
While RPC APIs can use JSON or XML for payloads, they are not inherently designed to define resources. Instead, they focus on invoking remote functions or methods.
- C. Correct.
REST APIs are centered around resources. Clients interact with these resources via standard HTTP methods, and each resource is typically identified by a URI.
- D. Correct.
RPC APIs are designed for invoking remote methods or procedures, mimicking function calls, rather than focusing on resources.
- E. Incorrect.
RPC APIs do not enforce a resource-based structure. They are more focused on calling specific procedures rather than interacting with resource representations.