Skip to content

iamkoushik1999/Rest-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rest-API

This repository contains How to create Rest API / CRUD Application

API stands for

Application Programming Interface.

REST stands for

REpresentational State Transfer.

CRUD Stands for

Create Read Update Delete

  • Create - POST
  • Read - GET
  • Update - PUT/PATCH
  • Delete - DELETE

CRUD

In regards to its use in RESTful APIs, CRUD is the standardized use of HTTP Action Verbs.

This means that if you want to create a new record you should be using “POST”. If you want to read a record, you should be using “GET”. To update a record use “PUT” or “PATCH”, And to delete a record, use “DELETE”.

HTTP Verbs

Below are the various types of HTTP Verbs

  • POST

A POST request is utilized to send data to a server to create a resource, for example, customer information, file upload, etc. usually using HTML Forms.

  • GET

The GET method is used to retrieve specific resource. Requests using GET should only retrieve data and should have no other effect on the data.

  • PUT

PUT is similar to POST as it is used to send data to the server to create or update a resource. The difference between it replaces all current representations of the target resource with the uploaded content.

  • PATCH

The PATCH method is used for making partial changes to an existing resource. The PATCH method provides an entity containing a list of changes to be applied to the resource requested using the URI.

  • DELETE

As it sounds, the DELETE request method is used to delete resources indicated by a specific URI. Making a DELETE request will remove the targeted resource.

  • PUT vs PATCH

PUT method uses the request URI to supply a modified version of the requested resource which replaces the original version of the resource, whereas the PATCH method supplies a set of instructions to modify the resource.