Day 21 – HTTP methods - Learning Node JS In 30 Days [Mini series]
Tags: node, javascript, codenewbie
Published: 2019-12-24 20:26:40

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
{% instagram B6dwK8NAYJD %}

Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/day21-nodejsin30days/). You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/) !


###__You can read the old posts from this series (below)__

{% post nerdjfpb/day-1-learning-node-js-in-30-days-mini-series-55e7 %}

{% post nerdjfpb/day-2-learning-node-js-in-30-days-mini-series-5023 %}

{% post nerdjfpb/day-3-learning-node-js-in-30-days-mini-series-24i4 %}

{% post nerdjfpb/day-4-learning-node-js-in-30-days-mini-series-1koc %}

{% post nerdjfpb/day-5-learning-node-js-in-30-days-mini-series-21jm %}

{% post nerdjfpb/day-6-learning-node-js-in-30-days-mini-series-758 %}

{% post nerdjfpb/day-7-learning-node-js-in-30-days-mini-series-3023 %}

{% post nerdjfpb/day-8-var-vs-let-vs-const-learning-node-js-in-30-days-mini-series-1i72 %}

{% post nerdjfpb/day-9-mastering-eventemitter-learning-node-js-in-30-days-mini-series-2dfe %}

{% post nerdjfpb/day-10-mastering-eventemitter-learning-node-js-in-30-days-mini-series-2802 %}

{% post nerdjfpb/day-11-creating-and-deleting-folders-learning-node-js-in-30-days-mini-series-3a2d %}

{% post nerdjfpb/day-12-creating-own-server-learning-node-js-in-30-days-mini-series-3ef %}

{% post nerdjfpb/day-13-buffer-stream-learning-node-js-in-30-days-mini-series-5c5d %}

{% post nerdjfpb/day-14-serving-html-pages-learning-node-js-in-30-days-mini-series-2hl3 %}

{% post nerdjfpb/day-15-sending-json-to-client-learning-node-js-in-30-days-mini-series-21pc %}

{% post nerdjfpb/day-16-routing-basic-learning-node-js-in-30-days-mini-series-5hk6 %}

{% post nerdjfpb/day-17-npm-node-package-manager-learning-node-js-in-30-days-mini-series-1nek %}

{% post nerdjfpb/day-18-why-express-js-learning-node-js-in-30-days-mini-series-b5a %}

{% post nerdjfpb/day-19-nodemon-learning-node-js-in-30-days-mini-series-m39 %}

{% post nerdjfpb/day-20-express-js-introduction-learning-node-js-in-30-days-mini-series-2pg5 %}