I am starting a series on node js. Actually I’m not super skilled with node js. So I thought let’s start from zero again and help others with me to learn about it. I saw the ‘the net ninja’ tutorials and took the syllabus from there and make a fusion of my own. I want to help you with my journey, let’s ride together into node js for 30 days…
Day 21 — HTTP methods — Learning Node JS In 30 Days [Mini series]
A full series to learn the basics easily of node js
We are going to learn about HTTP methods today. We already used this in our old codes. But we are going learn about a bit today.
Http methods are kind of request we made to the server.
We are most going to use 4 for our system
- GET
- POST
- DELETE
- PUT
GET — This is for getting data from server
like — We can get a anime list from server
in express js we use app.get
for this type request.
POST — This method is for sending something to server.
Like — We can send form data to server
in express js we use app.post
to this type request.
DELETE — This method is delete something in server
Like — we can delete a anime from the list
in express js we use app.delete
to this type request.
PUT — This is for updating something
like — we can update an anime name, for mis-spell
in express js we use app.put
to this type request.
REST API use this http protocol to send data over computers.
So we already wrote REST API by using app.get
, app.post
, app.delete
& app.put
Did you learn something new today ?
Originally it published on nerdjfpb blog and graphical version on instagram. you can connect with me in twitter, linkedin or instagram