DEV Community

Cover image for Day 21 – HTTP methods - Learning Node JS In 30 Days [Mini series]
Muhammad Ali (Nerdjfpb)
Muhammad Ali (Nerdjfpb)

Posted on • Originally published at blog.nerdjfpb.com

Day 21 – HTTP methods - Learning Node JS In 30 Days [Mini series]

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 ?

You can see the graphical version here

Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !

You can read the old posts from this series (below)

Top comments (0)