Friday 23 June 2017

Routing Question

I've read that when passing "valuable information" (password, etc) with a param route, you should use POST, since post hides the information in the history browser. Unlike GET, which exposes it.Something like this:router.post("/login/:email/:password", function(req, res){ var sql = "SELECT * FROM airbnb.user_authenticaiton WHERE email" + req.params.email app.con.query(sql, function (err, result) { if(err) console.log(err); console.log("1 record inserted"); }); But.. isn't POST only used when you want to insert something new? Unlike GET which will retrieve stuff.In my scenario, I want to retrieve the email data. Would it still be applicable for me to use POST?

Submitted June 23, 2017 at 06:31PM by badboyzpwns

No comments:

Post a Comment