1Maypole::Headers(3)   User Contributed Perl Documentation  Maypole::Headers(3)
2
3
4

NAME

6       Maypole::Headers - Convenience wrapper around HTTP::Headers
7

SYNOPSIS

9           use Maypole::Headers;
10
11           $r->headers_out(Maypole::Headers->new); # Note, automatic in Maypole
12           $r->headers_out->set('Content-Base' => 'http://localhost/maypole');
13           $r->headers_out->push('Set-Cookie' => $cookie->as_string);
14           $r->headers_out->push('Set-Cookie' => $cookie2->as_string);
15
16           print $r->headers_out->as_string;
17

DESCRIPTION

19       A convenience wrapper around "HTTP::Headers". Additional methods are
20       provided to make the mutators less repetitive and wordy. For example:
21
22           $r->headers_out->header(Content_Base => $r->config->uri_base);
23
24       can be written as:
25
26           $r->headers_out->set(Content_Base => $r->config->uri_base);
27

METHODS

29       All the standard HTTP::Headers methods, plus the following:
30
31       get($header)
32           Get the value of a header field.
33
34           An alias to "HTTP::Headers->header"
35
36       set($header ="gt" $value, ...)
37           Set the value of one or more header fields
38
39           An alias to "HTTP::Headers->header"
40
41       push($header ="gt" $value)
42           Add a value to the field named $header. Previous values are
43           maintained.
44
45           An alias to "HTTP::Headers->push_header"
46
47       add Alias to "push" - useful for "Apache::Session::Wrapper" support, in
48           CGI mode.
49
50       init($header ="gt" $value)
51           Set the value for the field named $header, but only if that header
52           is currently undefined.
53
54           An alias to "HTTP::Headers->init_header"
55
56       remove($header, ...)
57           Remove one of more headers
58
59           An alias to "HTTP::Headers->remove_header"
60
61       field_names()
62           Returns a list of distinct header names
63
64           An alias to "HTTP::Headers->header_field_names"
65

SEE ALSO

67       HTTP::Headers
68

AUTHOR

70       Simon Flack
71
72
73
74perl v5.36.0                      2023-01-20               Maypole::Headers(3)
Impressum