Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage example for formAttributes() #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs_md/core_manual_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1482,10 +1482,13 @@ 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();
// Do something with them
// Do something with them:
myCode.login(attrs.get('username'), attrs.get('password'));
});


Expand Down