Skip to content

Tag Archives: Express.js

The req.ips property contains an array of IP addresses specified in the X-Forwarded-For request header. It returns an array of IP addresses. Syntax: req.ips Parameter:… Read More
The req.ip property contains the remote IP address of the request. It is useful when the user wants the IP address of the incoming request… Read More
The req.hostname property contains the hostname which is derived from the Host HTTP header. It basically returns the hostname which is being supplied in the… Read More
The req.stale property indicates whether the incoming request is stale, and this property is the opposite of req.fresh property. Syntax: req.stale Parameter: No parameters. Return… Read More
The req.params property is an object containing properties mapped to the named route “parameters”. For example, if you have the route /student/:id, then the “id”… Read More
The req.originalUrl property is much like req.url however, it retains the original request URL thereby allowing you to rewrite req.url freely for internal routing purposes.… Read More
The req.param() function basically returns the value of param name when present. When parameters are passed, then it can be accessed using this function.Syntax:   req.param(name… Read More
The res.json() function sends a JSON response. This method sends a response (with the correct content-type) that is the parameter converted to a JSON string… Read More
The req.baseUrl property is the URL path on which a router instance was mounted. The req.baseUrl property is similar to the mount path property of… Read More
The res.attachment() function is used to set the HTTP response Content-Disposition header field to ‘attachment’. If the name of the file is given as filename,… Read More
The res.set() function is used to set the response HTTP header field to value. To set multiple fields at once, pass an object as the… Read More
The res.jsonp() function is used to send a JSON response with JSONP support and this function is similar to the res.json() function except that it… Read More
The req.protocol property contains the request protocol string which is either HTTP or (for TLS requests) https. When the trust proxy setting does not evaluate… Read More
The res.vary() function is used to add the field to the Vary response header, if it is not there already. The Vary header indicates which… Read More
The res.append() function appends the specified value to the HTTP response header field and if the header is not already set then it creates the… Read More

Start Your Coding Journey Now!