LBRY Block Explorer

LBRY Claims • 11-use-body-parser-to-parse-post

3321ec32acb23a372e0253a750dbe3b9ebe1bcae

Published By
Created On
25 Jun 2021 17:21:27 UTC
Transaction ID
Cost
Safe for Work
Free
Yes
11 - Use body-parser to Parse POST Requests - Basic Node and Express - freeCodeCamp Tutorial
We can use the 'body-parser' module to extract inputs from forms. These will be added to the body field of the request, when we call body-parser's urlencoded() method, which we can then use to submit a POST request.

Link to challenge : https://www.freecodecamp.org/learn/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests
Written Guide : https://www.notion.so/ganeshh123/Use-body-parser-to-Parse-POST-Requests-e8208ec5637b4ac8acc0f8770c4372ac

Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1SdIZ3uhbXnKAq2UcICSnWS
All Writen Guides for this course : https://www.notion.so/ganeshh123/dab5e189407244c793c2f32d066eee9f
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26

Concepts:
bodyParser.urlencoded()
Returns middleware that only parses urlencoded bodies and only looks at requests where the Content-Type header matches the type option. This parser accepts only UTF-8 encoding of the body and supports automatic inflation of gzip and deflate encodings. A new body object containing the parsed data is populated on the request object after the middleware (i.e. req.body). This object will contain key-value pairs, where the value can be a string or array (when extended is false), or any type (when extended is true).
https://github.com/expressjs/body-parser#bodyparserurlencodedoptions

request.body
Contains key-value pairs of data submitted in the request body. By default, it is undefined, and is populated when you use body-parsing middleware such as express.json() or express.urlencoded().
https://expressjs.com/en/api.html#req.body

app.use()
Mounts the specified middleware function or functions at the specified path: the middleware function is executed when the base of the requested path matches path.
https://expressjs.com/en/api.html#app.use

-————————————————————————————————————-
Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.

Express.js, or simply Express, is a web application framework for Node.js. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. Express runs between the server created by Node.js and the frontend pages of a web application. Express also handles an application's routing.

freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive
...
https://www.youtube.com/watch?v=7iQLkJ3rEQo
Author
Content Type
Unspecified
video/mp4
Language
English
Open in LBRY

More from the publisher

Controlling
VIDEO
2 - S
Controlling
VIDEO
FILE
Controlling
VIDEO
TIMES
Controlling
VIDEO
24 -
Controlling
VIDEO
6 - C
Controlling
VIDEO
09 -
Controlling
VIDEO
00 -
Controlling
VIDEO
09 -
Controlling
VIDEO
13 -