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

req.param() is now deprecated #314

Closed
dougwilson opened this issue Jan 14, 2015 · 3 comments
Closed

req.param() is now deprecated #314

dougwilson opened this issue Jan 14, 2015 · 3 comments

Comments

@dougwilson
Copy link
Contributor

It was dumb, and @hacksparrow bright it up :) Stomping out those weird CGI-isms :) People would just access properties in req.params, req.body or req.query.

Example migrations:

  • req.param('user') becomes either req.params.user if it's from the path, req.body.user, if it's a body field, or req.query.user if it's a query string parameter.
  • req.param('pageSize', 50) becomes either req.params.pageSize || 50, rea.body.pageSize || 50, req.query.pageSize || 50, etc. It could also be a full req.params.pageSize || req.body.pageSize || req.query.pageSize || 50 to mimic the full fallback (assumes you cannot specify a page size of 0).
@hacksparrow
Copy link
Member

Added deprecation notice - http://expressjs.com/4x/api.html#req.param

@dougwilson
Copy link
Contributor Author

LGTM

awg3 added a commit to awg3/userStory that referenced this issue Apr 5, 2016
updating the deprecated req.param('name'), from expressjs/expressjs.com#314
@Hillaryudechukwu
Copy link

This was very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants