Complete the code to set the Content-Type header to 'application/json'.
res.[1]('Content-Type', 'application/json');
The res.set method sets HTTP headers on the response. Here, it sets the 'Content-Type' header.
Complete the code to set multiple headers at once using an object.
res.[1]({ 'Cache-Control': 'no-cache', 'X-Powered-By': 'Express' });
The res.set method can accept an object to set multiple headers at once.
Fix the error in setting a header by completing the method name correctly.
res.[1]('Authorization', 'Bearer token123');
In Express, the correct method to set headers is res.set. setHeader is a Node.js method but not used directly on Express response objects.
Fill both blanks to set the 'Content-Language' header to 'en-US'.
res.[1]('[2]', 'en-US');
The res.set method sets headers. The header name here is 'Content-Language'.
Fill all three blanks to set headers 'X-Frame-Options' to 'DENY', 'Strict-Transport-Security' to 'max-age=31536000', and 'Referrer-Policy' to 'no-referrer'.
res.[1]({ [2]: 'DENY', [3]: 'max-age=31536000', 'Referrer-Policy': 'no-referrer' });
Use res.set to set multiple headers at once. The keys are the header names exactly as required.