Request Object Flashcards

1
Q

req.params

A

An array containing the named route parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

req.param(name)

A

Returns the named route parameter, or GET or POST paramaters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

req.query

A

An object containing the querystring parameters (some times called GET parameters) as name/value pairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

req.body

A

An object containing the POST parameters. requires body parser middleware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

req.route

A

Information about the currently matched route. useful for route debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

req.cookies

A

Object containing cookie values passed from the client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

req.headers

A

Headers received from the client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

req.accepts([types])

A

A convenience method to determine whether the client accepts a given type or types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

req.ip

A

The IP address of the client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

req.path

A

The request path (without protocol, host, port, or querystring)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

req.host

A

A convenience property that returns the hostname reported by the client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

req.xhr

A

A convenience property that returns true if the request originated from an AJAX call

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

req.protocol

A

The protocol used in making this request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

req.secure

A

A convenience property that returns true if the connection is secure. Equivalent to req.protocol === ‘https’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

req.url

A

Returns path and querystring (not protocol, host, or port). Can be re-written for internal routing purposes for internal routing purposes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

req.originalUrl

A

Returns path and querystring (not protocol, host, or port). Not designed to be rewritten

17
Q

req.acceptLanguages

A

A convenience method that returns an array of the (human) languages the client prefers, in order of preference