From 5188533e714f3d44e76aeb3452627e764f50f9fa Mon Sep 17 00:00:00 2001 From: plato Date: Sun, 15 Mar 2015 05:39:40 -0600 Subject: [PATCH 1/2] Add usage example for formAttributes() Thanks voidDotClass on irc --- docs_md/core_manual_js.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs_md/core_manual_js.md b/docs_md/core_manual_js.md index aa68b6b..5ebd181 100644 --- a/docs_md/core_manual_js.md +++ b/docs_md/core_manual_js.md @@ -1485,7 +1485,8 @@ If the request corresponds to an HTML form that was submitted you can use the fu request.endHandler(function() { // The request has been all ready so now we can look at the form attributes var attrs = request.formAttributes(); - // Do something with them + // Do something with them: + myCode.login(attrs.get('username'), attrs.get('password')); }); From c6bd019c639b42db148011b7b71126a6d6feed7f Mon Sep 17 00:00:00 2001 From: plato Date: Sun, 15 Mar 2015 05:43:23 -0600 Subject: [PATCH 2/2] Add another line to formAttributes() docs Add the missing line `request.expectMultiPart(true);` to the `formAttributes()` documentation --- docs_md/core_manual_js.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs_md/core_manual_js.md b/docs_md/core_manual_js.md index 5ebd181..eda8823 100644 --- a/docs_md/core_manual_js.md +++ b/docs_md/core_manual_js.md @@ -1482,6 +1482,8 @@ You can also stream it directly to disk using the convenience method `streamToFi If the request corresponds to an HTML form that was submitted you can use the function `formAttributes` to retrieve a Multi Map of the form attributes. This should only be called after *all* of the request has been read - this is because form attributes are encoded in the request *body* not in the request headers. + request.expectMultiPart(true); + request.endHandler(function() { // The request has been all ready so now we can look at the form attributes var attrs = request.formAttributes();