Files
Harkirat Singh 8f25305ab2 Update index.md (#35322)
* Update index.md

Completion of the solution code.

* fix: changed code to json
2019-06-12 17:39:51 -07:00

1.0 KiB

title
title
Use body-parser to Parse POST Requests

Use body-parser to Parse POST Requests

The body-parser should already be added to your project if you used the provided boilerplate, but if not it should be there as:

"dependencies": {
    "body-parser": "^1.4.3",
    ...

All you need to do for this challenge is pass the middleware to app.use(). Make sure it comes before the paths it needs to be used on. Remember that body-parser returns with bodyParser.urlencoded({extended: false}). Use the following as a template:

//app.use(middleware-function);
app.use(bodyParser.urlencoded({ extended: false }));

Help our community expand these hints and guides.