Name
header
Synopsis
$query->header([content_type,status,headers])
Generates the HTTP header for the document.
content_typeThe content type to return. Default is
text/html.statusThe HTTP status code and description to return. Default is
200 OK.headersAdditional headers to include, such as
Content-Length: 123. Using named parameters, the syntax is:print $query->header(-type=>'
content_type', -nph=>1, -status=>'status_code', -expires=>'expcode', -cookie=>'cookie', -target=>'frame', -header=>'value');-type=>content_typeSpecifies the content type.
-nph=>1Uses headers for a no-parse-header script.
-status=>status_codeSpecifies the status code.
-expires=>expcodeSpecifies an expiration timestamp (such as
+3dfor three days). Values forexpcodeare:nsnsecondsnmnminutesnhnhoursndndaysnMnmonthsnynyearsday_of_week,dd-MMM-YY hh:mm:ssGMTAt the specified time
nowExpires immediately
-cookie=>cookieSpecifies a cookie. The cookie may be a scalar value or an array reference.
-header=>valueSpecifies any HTTP header.
-target=>frameWrites to specified frame.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access