Can we work without Body-parser in Node.js?

+1 vote
I don't understand why we need body-parser in an Express application, as we can get data without it. And what does it do actually and how?
Jun 20, 2019 by shubham
• 6,910 points
83 views

1 answer to this question.

0 votes

To understand this question you first need to understand, how the request comes to your client

where URL specifies the server where you want to send the request too

The method specifies the HTTP Method like PUT, GET, POST, DELETE

The header provides metadata about your request 

The body says about the information you are requesting for

So when you get a request in this format to separate the body from the request you need body-parser and give it to the req.body

 

answered Jun 20, 2019 by sunshine
• 1,260 points

Related Questions

0 votes
1 answer

how to safely deploy npm install without it causing inconsistencies?

The recent versions on npm generates a ...READ MORE

answered Apr 11, 2018 in DevOps on Cloud by DareDev
• 6,850 points
107 views
0 votes
1 answer

Unable to request channel creation using Rest Api

I'd recommend taking a look at the ordering ...READ MORE

answered Jul 16, 2018 in Blockchain by Perry
• 17,090 points
217 views
0 votes
1 answer

Why do we use Body-parser in Node.js?

For understanding this first you need to ...READ MORE

answered May 20, 2019 in Others by sunshine
• 1,260 points
3,071 views
0 votes
1 answer

How can we create an HTTPS server in Node.js?

Hii, The Express API doc spells this out pretty clearly. I ...READ MORE

answered Apr 24 in Java-Script by Niroj
• 32,380 points
19 views
0 votes
1 answer
0 votes
1 answer

How many bots we can deploy in work fusion free version?

Hi Ranjandude, for a free version of ...READ MORE

answered May 30, 2019 in RPA by Abha
• 27,910 points
199 views
0 votes
1 answer

How can I include a JavaScript file in another JavaScript file in Node.js?

In Node.js to include a JavaScript file in ...READ MORE

answered Jul 30, 2019 by sunshine
• 1,260 points
79 views