Get or set the value of a header. The header field name is not case
sensitive. To make the life easier for perl users who wants to avoid
quoting before the => operator, you can use '_' as a synonym for '-'
in header names (this behaviour can be suppressed by setting
$HTTP::Headers::TRANSLATE_UNDERSCORE to a FALSE value).
The header() method accepts multiple ($field => $value) pairs, so you
can update several fields with a single invocation.
The optional $value argument may be a scalar or a reference to a list
of scalars. If the $value argument is undefined or not given, then the
header is not modified.
The old value of the last of the $field values is returned.
Multi-valued fields will be concatenated with ``,'' as separator in
Apply a subroutine to each header in turn. The callback routine is
called with two parameters; the name of the field and a single value.
If the header has more than one value, then the routine is called once
for each value. The field name passed to the callback routine has
case as suggested by HTTP Spec, and the headers will be visited in the
recommended ``Good Practice'' order.
Return the header fields as a formatted MIME header. Since it
internally uses the scan() method to build the string, the result
will use case as suggested by HTTP Spec, and it will follow
recommended ``Good Practice'' of ordering the header fieds. Long header
values are not folded.
The optional parameter specifies the line ending sequence to use. The
default is "\n". Embedded ``\n'' characters in the header will be
substitued with this line ending sequence.
Add a new field value of the specified header. The header field name
is not case sensitive. The field need not already have a
value. Previous values for the same field are retained. The argument
may be a scalar or a reference to a list of scalars.
The most frequently used headers can also be accessed through the
following convenience methods. These methods can both be used to read
and to set the value of a header. The header value is set if you pass
an argument to the method. The old header value is always returned.
Methods that deal with dates/times always convert their value to system
time (seconds since Jan 1, 1970) and they also expect this kind of
value when the header value is set.
This header is used to make a request conditional. If the requested
resource has (not) been modified since the time specified in this field,
then the server will return a "304 Not Modified" response instead of
the document itself.
This method is used to get or set an authorization header that use the
``Basic Authentication Scheme''. In array context it will return two
values; the user name and the password. In scalar context it will
return ``uname:password'' as a single string value.
When used to set the header value, it expects two arguments. E.g.:
The method will croak if the $uname contains a colon ':'.