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 by shubham
• 6,870 points
17 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 by sunshine
• 1,200 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,810 points
57 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,010 points
101 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 in Others by sunshine
• 1,200 points
29 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 in RPA by Abha
• 16,440 points
35 views
0 votes
3 answers

Can we run Spark without using Hadoop?

No, you can run spark without hadoop. ...READ MORE

answered May 7 in Big Data Hadoop by pradeep
121 views
0 votes
1 answer

Can we run selenium tests (Firefox) on WebDriver without a GUI?

You can explore options like HTMLUnit Driver ...READ MORE

answered Mar 23, 2018 in Selenium by nsv999
• 5,050 points
177 views