-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Comments
Added deprecation notice - http://expressjs.com/4x/api.html#req.param |
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
This was very helpful |
mkayaalp
added a commit
to mkayaalp/codeboard
that referenced
this issue
Oct 10, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was dumb, and @hacksparrow bright it up :) Stomping out those weird CGI-isms :) People would just access properties in
req.params
,req.body
orreq.query
.Example migrations:
req.param('user')
becomes eitherreq.params.user
if it's from the path,req.body.user
, if it's a body field, orreq.query.user
if it's a query string parameter.req.param('pageSize', 50)
becomes eitherreq.params.pageSize || 50
,rea.body.pageSize || 50
,req.query.pageSize || 50
, etc. It could also be a fullreq.params.pageSize || req.body.pageSize || req.query.pageSize || 50
to mimic the full fallback (assumes you cannot specify a page size of0
).The text was updated successfully, but these errors were encountered: