Skip to content

Commit 6bb100d

Browse files
committed
docs for req.get()
1 parent f13ea34 commit 6bb100d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docs/guide.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,17 @@ To utilize urlencoded request bodies, _req.body_
753753
should be an object. This can be done by using
754754
the _express.bodyParser middleware.
755755

756+
### req.get(field, param)
757+
758+
Get _field_'s _param_ value, defaulting to '' when the _param_
759+
or _field_ is not present.
760+
761+
req.get('content-disposition', 'filename');
762+
// => "something.png"
763+
764+
req.get('Content-Type', 'boundary');
765+
// => "--foo-bar-baz"
766+
756767
### req.flash(type[, msg])
757768

758769
Queue flash _msg_ of the given _type_.

lib/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ req.header = function(name, defaultValue){
7070
*
7171
* Examples:
7272
*
73-
* req.get('content-disposition', 'filename');
74-
* // => "something.png"
73+
* req.get('content-disposition', 'filename');
74+
* // => "something.png"
7575
*
7676
* @param {String} field
7777
* @param {String} param

0 commit comments

Comments
 (0)