DEV Community

Ali Osaid
Ali Osaid

Posted on • Updated on

HTTP methods in RESTful API development

so today topic is API;
API is Application programming interface we have some 4 most used method
GET
POST
PUT
DELETE

before we jump into GET,POST,PUT,DELETE, method lets talk about is why we need to use API what is the main reason

well our website have front-end and back-end we cant connect our front-end to our database. This is where back-end comes where we will create logic for our front-end side so we can send data to our database and recall it when needed

we make API to connect our front-end with our database

GET
This method is use to get all the data that is currently in our database we can show this data to our front-end by using fetch method or a library Axios that help us fetch data from API

POST
This method is use to send data from our front-end to our database it could be number string picture or anything we can also use schema if we using monogoose to make sure the correct form of data is been send to our backend

PUT
This method is used to update the data for example we need to a list of product because there price has been change

DELTE
you can tell from the name what this method going to do well yeah its going to delate the data that has been store in our backend

this is just a basic knowledge what is happening in backend but believe me there is a lot to learn

Top comments (3)

Collapse
 
webjose profile image
Info Comment hidden by post author - thread only accessible via permalink
José Pablo Ramírez Vargas

It's DELETE, not DELATE. I thought it was a typo, but I see you repeated it all over.

Collapse
 
xnova22 profile image
Ali Osaid

Yeah sorry it was typo mistake I'll fix it thanks :)

Collapse
 
zaemchilling profile image
ZaemOwO

Very interesting if I may say so myself

Some comments have been hidden by the post's author - find out more