REST APIs: Characteristics and Benefits | Cisco Exam 300-835-CLAUTO

REST APIs

Question

Which two characteristics of REST APIs? (Choose two.)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

AB.

REST (Representational State Transfer) is a software architectural style for building distributed systems based on hypermedia. RESTful APIs are built on top of the HTTP protocol and use HTTP methods such as GET, POST, PUT, and DELETE to perform CRUD (Create, Read, Update, and Delete) operations.

The two characteristics of REST APIs are:

A. Resources are accessed using Uniform Resource Identifiers (URIs): In REST APIs, every resource has a unique URI, which identifies the resource and is used to access it. URIs are typically composed of a base URL followed by a resource path. For example, the URI for a specific user resource might be https://api.example.com/users/{user_id}, where {user_id} is a parameter that specifies the ID of the user.

B. API operations for Create/Read/Update/Delete are mapped to standard HTTP methods: REST APIs use HTTP methods to perform CRUD operations on resources. The standard HTTP methods are:

  • GET: retrieves a representation of a resource
  • POST: creates a new resource
  • PUT: updates an existing resource
  • DELETE: deletes a resource

For example, to create a new user resource using a REST API, a client would send an HTTP POST request to the URI for the user resource, with the user data in the request body.

C. Cookies are not used for the duration of the session: Cookies are not typically used in REST APIs to manage the session state. Instead, the client includes authentication credentials in each request, such as an access token or API key.

D. REST API does not extend Remote Procedure Call (RPC): RESTful APIs are not based on the Remote Procedure Call (RPC) model, which involves calling a remote function and passing parameters to it.

E. The server does not manage the session state: REST APIs are stateless, meaning that the server does not manage the session state. Each request contains all the necessary information for the server to process it, and the server does not retain any state information between requests.