Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to access POST form fields in Express

// assuming POST: name=foo&color=red            <-- URL encoding
//
// or       POST: {"name":"foo","color":"red"}  <-- JSON encoding

app.post('/test-page', function(req, res) {
    var name = req.body.name,
        color = req.body.color;
    // ...
});
 
PREVIOUS NEXT
Tagged: #How #access #POST #form #fields #Express
ADD COMMENT
Topic
Name
9+9 =