From e202b917d62137e7b1b35ef0136e520b35ff6d99 Mon Sep 17 00:00:00 2001 From: Harkirat Singh Date: Thu, 21 Feb 2019 23:02:41 +0530 Subject: [PATCH] Update index.md (#35323) * Update index.md Completion of solution code. * Update guide/english/certifications/apis-and-microservices/basic-node-and-express/get-data-from-post-requests/index.md Co-Authored-By: Harkirat155 * Update guide/english/certifications/apis-and-microservices/basic-node-and-express/get-data-from-post-requests/index.md Co-Authored-By: Harkirat155 --- .../get-data-from-post-requests/index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guide/english/certifications/apis-and-microservices/basic-node-and-express/get-data-from-post-requests/index.md b/guide/english/certifications/apis-and-microservices/basic-node-and-express/get-data-from-post-requests/index.md index 1887416763..2d1c963a02 100644 --- a/guide/english/certifications/apis-and-microservices/basic-node-and-express/get-data-from-post-requests/index.md +++ b/guide/english/certifications/apis-and-microservices/basic-node-and-express/get-data-from-post-requests/index.md @@ -10,12 +10,22 @@ Just like using req.query we can do req.body to get our data. This challenge is In order to get data from a post request a general format is: +## Hint ```javascript app.post(PATH, function(req, res) { // Handle the data in the request }); ``` +## Solution +```javascript +app.post('/name', function(req, res) { + // Handle the data in the request + var string = req.body.first+ ' '+req.body.last; + res.json({"name": string}); +}); +``` + Help our community expand these hints and guides.