OpenSource For You

The Express request object and its methods

-

This object is a wrapper for Node.js’ http.request object. The code, req.get(‘Content-Type’) ; returns the HTTP request header. The code, req.is(‘text/html’); returns ‘true’ if the MIME type is text/HTML. Some frequently used functions are listed below: accepts() acceptsCha­rsets() acceptsEnc­odings() acceptsLan­guages() param() 1. 2. 3. 4. 5.

Newspapers in English

Newspapers from India