Reference: header
Author: Ellen Siever, Stephen Spainhour & Nathan Patwardhan
Date: 1999-07-02T01:55:51Z

#

| Chapter 10 The CGI.pm Module |

## header

     print $query->header([content_type ,status ,headers])

Generates the HTTP header for the document.

content_type

  The content type to return. Default is `text/html`.

status

  The HTTP status code and description to return. Default is `200 OK`.

headers

  Additional 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_type`

    Specify the content type.

  `-nph=>1`

    Use headers for a no-parse-header script.

  `-status=>``status_code`

    Specify the status code.

  `-expires=>``expcode`

    Specify an expiration timestamp (such as `+3d` for 3 days). Values for `expcode` are:

    `n` `s`

      `n` seconds

    `n` `m`

      `n` minutes

    `n` `h`

      `n` hours

    `n` `d`

      `n` days

    `n` `M`

      `n` months

    `n` `Y`

      `n` years

    `day_of_week`, `dd`-`MMM`-`YY hh:mm:ss` `GMT`

      At the specified time

    `now`

      Expire immediately.

  `-cookie=>``cookie`

    Specify a cookie. The cookie may be a scalar value or an array reference.

  `-header=>``value`

    Specify any HTTP header.

  `-target=>``frame`

    Write to specified frame.

Reference: filefield |  | Reference: hidden