Search...
headers
Sets or gets the HTTP response header fields.
Description
The headers
property contains an object of key:value
pairs where the key
is the header field name and the value
is the header field value.
When defining a content-type
key, note that for Free sites,text/html
is not
supported. Premium sites support all content types.
Type:
ObjectRead & Write
Was this helpful?
Get the response headers
Copy Code
1// In http-functions.js23export function use_myFunction(request) {45 let headers = response.headers;67 /* headers:8 * {9 * "content-type": "application/json",10 * "last-modified": "Tue, 26 Sep 2017 00:00:00 GMT"11 * }12 */1314}
Set the response headers
Copy Code
1// In http-functions.js23export function use_myFunction(request) {45 const headers = {6 "content-type": "application/json",7 "last-modified": "Tue, 26 Sep 2017 00:00:00 GMT"8 };910 response.headers = headers;1112}