Last active
August 29, 2015 14:17
-
-
Save jtroxel/5950f90b5fddd11871ab to your computer and use it in GitHub Desktop.
Javascript form post handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// curl --data-urlencode "name=Thai Green and Sushi" -XPOST localhost:8080/restaurant | |
routeMatcher.post('/restaurant', function (req) { | |
console.log("Params: " + req.params()); | |
req.expectMultiPart(true); | |
req.endHandler(function() { | |
// The request has been all ready so now we can look at the form attributes | |
var formAttributes = req.formAttributes(); | |
var name = formAttributes.get('name'); | |
console.log("Name: " + name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment