Question

What is a 'RESTful API' and what are its key architectural constraints?

A A database query language for web applications; constraints include mandatory encryption and authentication Correct Answer Incorrect Answer
B A messaging protocol for asynchronous communication between web services; key constraints include statelessness, client-server separation, uniform interface and cacheability Correct Answer Incorrect Answer
C A remote procedure call protocol for inter-service communication; requires persistent connections Correct Answer Incorrect Answer
D An architectural style for distributed systems using HTTP; key constraints include statelessness, client-server separation, uniform interface, cacheability, layered system, and optional code-on-demand Correct Answer Incorrect Answer
E A security protocol for authenticating web service consumers Correct Answer Incorrect Answer

Solution

REST (Representational State Transfer) uses standard HTTP methods: GET (retrieve), POST (create), PUT (update/replace), PATCH (partial update), DELETE (remove). Resources identified by URIs (e.g., /api/accounts/12345). Stateless means each request contains all necessary context (no server-side session state). Returns JSON or XML. Status codes indicate outcomes (200 OK, 201 Created, 404 Not Found, 401 Unauthorized). Banking APIs (Account Aggregator, UPI, Open Banking) extensively use REST. APIs must be secured with OAuth 2.0 + HTTPS.

Practice Next

Relevant for Exams:

ask-question