0% found this document useful (0 votes)
20 views12 pages

What Is Rest and Rest API

The document outlines the principles of REST architecture for developing Web APIs, specifically focusing on REST APIs or RESTful APIs. It describes how these APIs function through client requests and responses, detailing CRUD operations (Create, Read, Update, Delete) and providing examples of HTTP methods used for each operation. Additionally, it includes a specific example of a Students API resource and the corresponding request-response patterns for various operations.

Uploaded by

sohel kazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views12 pages

What Is Rest and Rest API

The document outlines the principles of REST architecture for developing Web APIs, specifically focusing on REST APIs or RESTful APIs. It describes how these APIs function through client requests and responses, detailing CRUD operations (Create, Read, Update, Delete) and providing examples of HTTP methods used for each operation. Additionally, it includes a specific example of a Students API resource and the corresponding request-response patterns for various operations.

Uploaded by

sohel kazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

REST

It is an architectural guideline to develop Web API.


REST API
The API which is developed using REST is known as REST API / RESTful
API.
REST Web API
Web Application

Database
How REST Web API Works

Web API

Database
Web Application

• Client makes HTTP Request to API


• API will communicate to Web Application/Database (If needed)
• Web Application/Database provides required data to API
• API returns Response Data to Client

Note – Json Data, XML Data


REST API
CRUD Operations:-

Operation HTTP Methods Description


Create POST Creating/Posting/Inserting Data
Read GET Reading/Getting/Retrieving Data
Updating Data
Update PUT, PATCH Complete Update - PUT
Partial Update - PATCH
Delete DELETE Deleting Data
Students API Resource
http://geekyshows.com/api/students

1 2 3

1. Base URL
2. Naming Convention
3. Resource of API or End-Point
Request - Response
• Request for All Students

Response

Request [
{"id":1, "name": "Rahul"},
GET: /api/students {"id":2, "name" : "Sonam"},
….
]
Request - Response
• Request for One Student having id = 1

Response
Request
[
GET: /api/students/1 {"id":1, "name": "Rahul" }
]
Request - Response
• Request Posting/Creating/Inserting Data

Request
Response
POST: api/students
{"id":11, "name": “Sumit”}
{"name": “Sumit"}
Request - Response
• Request for Updating Data, id = 1

Response
Request
[
PUT or PATCH: /api/students/1 {"id":1, "name": "Raj" }
]
{"name": “Raj" }
Request - Response
• Request for Deleting Data, id = 1

Request Response

DELETE: /api/students/1 {"id":1, "name": "Raj" }


RESTful API
http://geekyshows.com/api/students

GET /api/students
GET /api/students/1
POST /api/students
PUT /api/students/1
PATCH /api/students/1
DELETE /api/students/1

You might also like