Skip to content

Tag Archives: Express.js

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
The res.end() function is used to end the response process. This method actually comes from the Node core, specifically the response.end() method of HTTP.ServerResponse. Use… Read More
The req.secure property is an Boolean property that is true if a TLS connection is established else return false. Syntax: req.secure Return Value: It return… Read More
The res.send() function basically sends the HTTP response. The body parameter can be a String or a Buffer object or an object or an Array.… Read More
The res.sendFile() function basically transfers the file at the given path and it sets the Content-Type response HTTP header field based on the filename extension. Syntax: … Read More
The res.download() function transfers the file at path as an ‘attachment’. Typically, browsers will prompt the user to download. Syntax: res.download(path [, filename] [, options]… Read More
he res.get() function returns the HTTP response header specified by field. The match is case-insensitive.Syntax:  res.get( field ) Parameter: The field parameter describes the name… Read More
The req.subdomains property contains an array of subdomains in the domain name of the request. The application property subdomain offset, which defaults to 2 which… Read More
The req.xhr property returns a true value if the request’s X-Requested-With header field is XMLHttpRequest which indicates that the request was issued by a client… Read More
The res.status() function set the HTTP status for the response. It is a chainable alias of Node’s response.statusCode. Syntax: res.status( code ) Parameter: This function… Read More
The res.links() function is used to join the links provided as properties of the parameter to populate the response’s Link HTTP header field.Syntax:   res.links( links… Read More
The res.cookie() function is used to set the cookie name to value. The value parameter may be a string or object converted to JSON.Syntax:   res.cookie(name,… Read More

Start Your Coding Journey Now!