Open enginespot opened 11 years ago
strata.get("/register", function(env, callback) { var content; content = ""; content += "<form action=\"/register\" method=\"post\" enctype=\"text/plain\">"; content += "<input name=\"name\" type=\"text\">"; content += "<input name=\"password\" type=\"password\">"; content += "<input type=\"submit\" value=\"Register\">"; content += "</form>"; callback(200, {}, content); }); strata.post("/register", function(env, callback) { var req; req = strata.Request(env); req.body(function(err, body) { if (err && strata.handleError(err, env, callback)) { return; } console.log(body); }); });
when I use curl post curl -v --data "name=a&password=b" http://localhost:3000/register
the data parsed to a json data
but when I use form submit
the data does not parsed , it is string "name=a password=b"
when I use curl post curl -v --data "name=a&password=b" http://localhost:3000/register
the data parsed to a json data
but when I use form submit
the data does not parsed , it is string "name=a password=b"