ASP.NET Core Web API Interview Question #2

What is REST, and how is it related to Web APIs?

Web API & REST Fundamentals, Controllers, HTTP Methods & Status Codes Junior Beginner

Quick Interview Answer

REST stands for Representational State Transfer. It is an architectural style for networked systems in which resources are identified by URIs and manipulated through standard HTTP semantics.

Detailed Explanation

REST stands for Representational State Transfer. It is an architectural style for networked systems in which resources are identified by URIs and manipulated through standard HTTP semantics.

A REST-oriented Web API typically models business concepts as resources, uses HTTP methods consistently, returns meaningful status codes, and keeps requests sufficiently self-contained. ASP.NET Core can build REST APIs, but simply using ASP.NET Core does not automatically make an API RESTful.

Code Example

GET    /api/products
GET    /api/products/10
POST   /api/products
PUT    /api/products/10
DELETE /api/products/10