Maypole::Headers(3)
π Maypole::Headers π
okay bestie, gather round, because this is the little module that makes your HTTP headers situation so much cuter. it's a convenience wrapper around HTTP::Headers β that's the whole vibe. β¨
πΈ NAME πΈ
Maypole::Headers β a convenience wrapper around HTTP::Headers. she's small, she's helpful, she's lowkey carrying your whole response. π
π SYNOPSIS π
use Maypole::Headers;
$r->headers_out(Maypole::Headers->new); # Note, automatic in Maypole
$r->headers_out->set('Content-Base' => 'http://localhost/maypole');
$r->headers_out->push('Set-Cookie' => $cookie->as_string);
$r->headers_out->push('Set-Cookie' => $cookie2->as_string);
print $r->headers_out->as_string;
like. look at her. set, push, as_string, done. no notes. π«Ά
π¦ DESCRIPTION π¦
so basically it's a convenience wrapper around HTTP::Headers, but with extra methods sprinkled on top so your mutators stop being so repetitive and wordy. it's giving less typing, same power. β¨
for example, this:
$r->headers_out->header(Content_Base => $r->config->uri_base);
can be written as:
$r->headers_out->set(Content_Base => $r->config->uri_base);
same thing, shorter name, cuter energy. periodt. π
π METHODS π
you get all the standard HTTP::Headers methods, plus these icons right here:
get($header)β gets the value of a header field. it's an alias toHTTP::Headers->header. πset($header ="gt" $value, ...)β sets the value of one or more header fields. also an alias toHTTP::Headers->header. you can pass a whole little pile of them, hence the.... πpush($header ="gt" $value)β adds a value to the field named$header, and bestie, the previous values are maintained. nothing gets thrown away here. it's an alias toHTTP::Headers->push_header. π₯addβ alias topushβ useful forApache::Session::Wrappersupport, in CGI mode. yeah, that's the whole entry. iconic of her honestly. πinit($header ="gt" $value)β sets the value for the field named$header, but only if that header is currently undefined. so if it's already set, she minds her business and does nothing. it's an alias toHTTP::Headers->init_header. π§remove($header, ...)β removes one or more headers. yes plural, go off. it's an alias toHTTP::Headers->remove_header. πfield_names()β returns a list of distinct header names. it's an alias toHTTP::Headers->header_field_names. β
π SEE ALSO π
HTTP::Headers β the original queen this whole thing wraps around. go pay her a visit. π
β¨ AUTHOR β¨
Simon Flack β thank you for your service, king. π«Ά
and that's the whole page, bestie!! this was perl v5.42.0, dated 2025-07-25, filed under Maypole::Headers(3) β no cap, go forth and set your headers. mwah. πβ¨π¦πΈ
π¦ where this page comes from
- fedora 43: perl-Maypole 1:2.13-46.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms