Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man3 / HTTP::Headers.3pm
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "HTTP::Headers 3"
132 .TH HTTP::Headers 3 "2009-06-15" "perl v5.8.7" "User Contributed Perl Documentation"
133 .SH "NAME"
134 HTTP::Headers \- Class encapsulating HTTP Message headers
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 .Vb 2
138 \& require HTTP::Headers;
139 \& $h = HTTP::Headers\->new;
140 .Ve
141 .PP
142 .Vb 3
143 \& $h\->header('Content\-Type' => 'text/plain');  # set
144 \& $ct = $h\->header('Content\-Type');            # get
145 \& $h\->remove_header('Content\-Type');           # delete
146 .Ve
147 .SH "DESCRIPTION"
148 .IX Header "DESCRIPTION"
149 The \f(CW\*(C`HTTP::Headers\*(C'\fR class encapsulates HTTP-style message headers.
150 The headers consist of attribute-value pairs also called fields, which
151 may be repeated, and which are printed in a particular order.  The
152 field names are cases insensitive.
153 .PP
154 Instances of this class are usually created as member variables of the
155 \&\f(CW\*(C`HTTP::Request\*(C'\fR and \f(CW\*(C`HTTP::Response\*(C'\fR classes, internal to the
156 library.
157 .PP
158 The following methods are available:
159 .IP "$h = HTTP::Headers\->new" 4
160 .IX Item "$h = HTTP::Headers->new"
161 Constructs a new \f(CW\*(C`HTTP::Headers\*(C'\fR object.  You might pass some initial
162 attribute-value pairs as parameters to the constructor.  \fIE.g.\fR:
163 .Sp
164 .Vb 4
165 \& $h = HTTP::Headers\->new(
166 \&       Date         => 'Thu, 03 Feb 1994 00:00:00 GMT',
167 \&       Content_Type => 'text/html; version=3.2',
168 \&       Content_Base => 'http://www.perl.org/');
169 .Ve
170 .Sp
171 The constructor arguments are passed to the \f(CW\*(C`header\*(C'\fR method which is
172 described below.
173 .IP "$h\->clone" 4
174 .IX Item "$h->clone"
175 Returns a copy of this \f(CW\*(C`HTTP::Headers\*(C'\fR object.
176 .ie n .IP "$h\->header( $field )" 4
177 .el .IP "$h\->header( \f(CW$field\fR )" 4
178 .IX Item "$h->header( $field )"
179 .PD 0
180 .ie n .IP "$h\->header( $field\fR => \f(CW$value )" 4
181 .el .IP "$h\->header( \f(CW$field\fR => \f(CW$value\fR )" 4
182 .IX Item "$h->header( $field => $value )"
183 .ie n .IP "$h\->header( $f1\fR => \f(CW$v1\fR, \f(CW$f2\fR => \f(CW$v2, ... )" 4
184 .el .IP "$h\->header( \f(CW$f1\fR => \f(CW$v1\fR, \f(CW$f2\fR => \f(CW$v2\fR, ... )" 4
185 .IX Item "$h->header( $f1 => $v1, $f2 => $v2, ... )"
186 .PD
187 Get or set the value of one or more header fields.  The header field
188 name ($field) is not case sensitive.  To make the life easier for perl
189 users who wants to avoid quoting before the => operator, you can use
190 \&'_' as a replacement for '\-' in header names.
191 .Sp
192 The \fIheader()\fR method accepts multiple ($field => \f(CW$value\fR) pairs, which
193 means that you can update several fields with a single invocation.
194 .Sp
195 The \f(CW$value\fR argument may be a plain string or a reference to an array
196 of strings for a multi-valued field. If the \f(CW$value\fR is provided as
197 \&\f(CW\*(C`undef\*(C'\fR then the field is removed.  If the \f(CW$value\fR is not given, then
198 that header field will remain unchanged.
199 .Sp
200 The old value (or values) of the last of the header fields is returned.
201 If no such field exists \f(CW\*(C`undef\*(C'\fR will be returned.
202 .Sp
203 A multi-valued field will be returned as separate values in list
204 context and will be concatenated with \*(L", \*(R" as separator in scalar
205 context.  The \s-1HTTP\s0 spec (\s-1RFC\s0 2616) promise that joining multiple
206 values in this way will not change the semantic of a header field, but
207 in practice there are cases like old-style Netscape cookies (see
208 HTTP::Cookies) where \*(L",\*(R" is used as part of the syntax of a single
209 field value.
210 .Sp
211 Examples:
212 .Sp
213 .Vb 6
214 \& $header\->header(MIME_Version => '1.0',
215 \&                 User_Agent   => 'My\-Web\-Client/0.01');
216 \& $header\->header(Accept => "text/html, text/plain, image/*");
217 \& $header\->header(Accept => [qw(text/html text/plain image/*)]);
218 \& @accepts = $header\->header('Accept');  # get multiple values
219 \& $accepts = $header\->header('Accept');  # get values as a single string
220 .Ve
221 .ie n .IP "$h\->push_header( $field\fR => \f(CW$value )" 4
222 .el .IP "$h\->push_header( \f(CW$field\fR => \f(CW$value\fR )" 4
223 .IX Item "$h->push_header( $field => $value )"
224 .PD 0
225 .ie n .IP "$h\->push_header( $f1\fR => \f(CW$v1\fR, \f(CW$f2\fR => \f(CW$v2, ... )" 4
226 .el .IP "$h\->push_header( \f(CW$f1\fR => \f(CW$v1\fR, \f(CW$f2\fR => \f(CW$v2\fR, ... )" 4
227 .IX Item "$h->push_header( $f1 => $v1, $f2 => $v2, ... )"
228 .PD
229 Add a new field value for the specified header field.  Previous values
230 for the same field are retained.
231 .Sp
232 As for the \fIheader()\fR method, the field name ($field) is not case
233 sensitive and '_' can be used as a replacement for '\-'.
234 .Sp
235 The \f(CW$value\fR argument may be a scalar or a reference to a list of
236 scalars.
237 .Sp
238 .Vb 2
239 \& $header\->push_header(Accept => 'image/jpeg');
240 \& $header\->push_header(Accept => [map "image/$_", qw(gif png tiff)]);
241 .Ve
242 .ie n .IP "$h\->init_header( $field\fR => \f(CW$value )" 4
243 .el .IP "$h\->init_header( \f(CW$field\fR => \f(CW$value\fR )" 4
244 .IX Item "$h->init_header( $field => $value )"
245 Set the specified header to the given value, but only if no previous
246 value for that field is set.
247 .Sp
248 The header field name ($field) is not case sensitive and '_'
249 can be used as a replacement for '\-'.
250 .Sp
251 The \f(CW$value\fR argument may be a scalar or a reference to a list of
252 scalars.
253 .ie n .IP "$h\->remove_header( $field, ... )" 4
254 .el .IP "$h\->remove_header( \f(CW$field\fR, ... )" 4
255 .IX Item "$h->remove_header( $field, ... )"
256 This function removes the header fields with the specified names.
257 .Sp
258 The header field names ($field) are not case sensitive and '_'
259 can be used as a replacement for '\-'.
260 .Sp
261 The return value is the values of the fields removed.  In scalar
262 context the number of fields removed is returned.
263 .Sp
264 Note that if you pass in multiple field names then it is generally not
265 possible to tell which of the returned values belonged to which field.
266 .IP "$h\->remove_content_headers" 4
267 .IX Item "$h->remove_content_headers"
268 This will remove all the header fields used to describe the content of
269 a message.  All header field names prefixed with \f(CW\*(C`Content\-\*(C'\fR falls
270 into this category, as well as \f(CW\*(C`Allow\*(C'\fR, \f(CW\*(C`Expires\*(C'\fR and
271 \&\f(CW\*(C`Last\-Modified\*(C'\fR.  \s-1RFC\s0 2616 denote these fields as \fIEntity Header
272 Fields\fR.
273 .Sp
274 The return value is a new \f(CW\*(C`HTTP::Headers\*(C'\fR object that contains the
275 removed headers only.
276 .IP "$h\->clear" 4
277 .IX Item "$h->clear"
278 This will remove all header fields.
279 .IP "$h\->header_field_names" 4
280 .IX Item "$h->header_field_names"
281 Returns the list of distinct names for the fields present in the
282 header.  The field names have case as suggested by \s-1HTTP\s0 spec, and the
283 names are returned in the recommended \*(L"Good Practice\*(R" order.
284 .Sp
285 In scalar context return the number of distinct field names.
286 .IP "$h\->scan( \e&process_header_field )" 4
287 .IX Item "$h->scan( &process_header_field )"
288 Apply a subroutine to each header field in turn.  The callback routine
289 is called with two parameters; the name of the field and a single
290 value (a string).  If a header field is multi\-valued, then the
291 routine is called once for each value.  The field name passed to the
292 callback routine has case as suggested by \s-1HTTP\s0 spec, and the headers
293 will be visited in the recommended \*(L"Good Practice\*(R" order.
294 .Sp
295 Any return values of the callback routine are ignored.  The loop can
296 be broken by raising an exception (\f(CW\*(C`die\*(C'\fR), but the caller of \fIscan()\fR
297 would have to trap the exception itself.
298 .IP "$h\->as_string" 4
299 .IX Item "$h->as_string"
300 .PD 0
301 .ie n .IP "$h\->as_string( $eol )" 4
302 .el .IP "$h\->as_string( \f(CW$eol\fR )" 4
303 .IX Item "$h->as_string( $eol )"
304 .PD
305 Return the header fields as a formatted \s-1MIME\s0 header.  Since it
306 internally uses the \f(CW\*(C`scan\*(C'\fR method to build the string, the result
307 will use case as suggested by \s-1HTTP\s0 spec, and it will follow
308 recommended \*(L"Good Practice\*(R" of ordering the header fields.  Long header
309 values are not folded.
310 .Sp
311 The optional \f(CW$eol\fR parameter specifies the line ending sequence to
312 use.  The default is \*(L"\en\*(R".  Embedded \*(L"\en\*(R" characters in header field
313 values will be substituted with this line ending sequence.
314 .SH "CONVENIENCE METHODS"
315 .IX Header "CONVENIENCE METHODS"
316 The most frequently used headers can also be accessed through the
317 following convenience Methods.  Most of these methods can both be used to read
318 and to set the value of a header.  The header value is set if you pass
319 an argument to the method.  The old header value is always returned.
320 If the given header did not exist then \f(CW\*(C`undef\*(C'\fR is returned.
321 .PP
322 Methods that deal with dates/times always convert their value to system
323 time (seconds since Jan 1, 1970) and they also expect this kind of
324 value when the header value is set.
325 .IP "$h\->date" 4
326 .IX Item "$h->date"
327 This header represents the date and time at which the message was
328 originated. \fIE.g.\fR:
329 .Sp
330 .Vb 1
331 \&  $h\->date(time);  # set current date
332 .Ve
333 .IP "$h\->expires" 4
334 .IX Item "$h->expires"
335 This header gives the date and time after which the entity should be
336 considered stale.
337 .IP "$h\->if_modified_since" 4
338 .IX Item "$h->if_modified_since"
339 .PD 0
340 .IP "$h\->if_unmodified_since" 4
341 .IX Item "$h->if_unmodified_since"
342 .PD
343 These header fields are used to make a request conditional.  If the requested
344 resource has (or has not) been modified since the time specified in this field,
345 then the server will return a \f(CW\*(C`304 Not Modified\*(C'\fR response instead of
346 the document itself.
347 .IP "$h\->last_modified" 4
348 .IX Item "$h->last_modified"
349 This header indicates the date and time at which the resource was last
350 modified. \fIE.g.\fR:
351 .Sp
352 .Vb 6
353 \&  # check if document is more than 1 hour old
354 \&  if (my $last_mod = $h\->last_modified) {
355 \&      if ($last_mod < time \- 60*60) {
356 \&          ...
357 \&      }
358 \&  }
359 .Ve
360 .IP "$h\->content_type" 4
361 .IX Item "$h->content_type"
362 The Content-Type header field indicates the media type of the message
363 content. \fIE.g.\fR:
364 .Sp
365 .Vb 1
366 \&  $h\->content_type('text/html');
367 .Ve
368 .Sp
369 The value returned will be converted to lower case, and potential
370 parameters will be chopped off and returned as a separate value if in
371 an array context.  If there is no such header field, then the empty
372 string is returned.  This makes it safe to do the following:
373 .Sp
374 .Vb 5
375 \&  if ($h\->content_type eq 'text/html') {
376 \&     # we enter this place even if the real header value happens to
377 \&     # be 'TEXT/HTML; version=3.0'
378 \&     ...
379 \&  }
380 .Ve
381 .IP "$h\->content_type_charset" 4
382 .IX Item "$h->content_type_charset"
383 Returns the upper-cased charset specified in the Content-Type header.  In list
384 context return the lower-cased bare content type followed by the upper-cased
385 charset.  Both values will be \f(CW\*(C`undef\*(C'\fR if not specified in the header.
386 .IP "$h\->content_is_text" 4
387 .IX Item "$h->content_is_text"
388 Returns \s-1TRUE\s0 if the Content-Type header field indicate that the
389 content is textual.
390 .IP "$h\->content_is_html" 4
391 .IX Item "$h->content_is_html"
392 Returns \s-1TRUE\s0 if the Content-Type header field indicate that the
393 content is some kind of \s-1HTML\s0 (including \s-1XHTML\s0).  This method can't be
394 used to set Content\-Type.
395 .IP "$h\->content_is_xhtml" 4
396 .IX Item "$h->content_is_xhtml"
397 Returns \s-1TRUE\s0 if the Content-Type header field indicate that the
398 content is \s-1XHTML\s0.  This method can't be used to set Content\-Type.
399 .IP "$h\->content_is_xml" 4
400 .IX Item "$h->content_is_xml"
401 Returns \s-1TRUE\s0 if the Content-Type header field indicate that the
402 content is \s-1XML\s0.  This method can't be used to set Content\-Type.
403 .IP "$h\->content_encoding" 4
404 .IX Item "$h->content_encoding"
405 The Content-Encoding header field is used as a modifier to the
406 media type.  When present, its value indicates what additional
407 encoding mechanism has been applied to the resource.
408 .IP "$h\->content_length" 4
409 .IX Item "$h->content_length"
410 A decimal number indicating the size in bytes of the message content.
411 .IP "$h\->content_language" 4
412 .IX Item "$h->content_language"
413 The natural language(s) of the intended audience for the message
414 content.  The value is one or more language tags as defined by \s-1RFC\s0
415 1766.  Eg. \*(L"no\*(R" for some kind of Norwegian and \*(L"en\-US\*(R" for English the
416 way it is written in the \s-1US\s0.
417 .IP "$h\->title" 4
418 .IX Item "$h->title"
419 The title of the document.  In libwww-perl this header will be
420 initialized automatically from the <\s-1TITLE\s0>...</TITLE> element
421 of \s-1HTML\s0 documents.  \fIThis header is no longer part of the \s-1HTTP\s0
422 standard.\fR
423 .IP "$h\->user_agent" 4
424 .IX Item "$h->user_agent"
425 This header field is used in request messages and contains information
426 about the user agent originating the request.  \fIE.g.\fR:
427 .Sp
428 .Vb 1
429 \&  $h\->user_agent('Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0)');
430 .Ve
431 .IP "$h\->server" 4
432 .IX Item "$h->server"
433 The server header field contains information about the software being
434 used by the originating server program handling the request.
435 .IP "$h\->from" 4
436 .IX Item "$h->from"
437 This header should contain an Internet e\-mail address for the human
438 user who controls the requesting user agent.  The address should be
439 machine\-usable, as defined by \s-1RFC822\s0.  E.g.:
440 .Sp
441 .Vb 1
442 \&  $h\->from('King Kong <king@kong.com>');
443 .Ve
444 .Sp
445 \&\fIThis header is no longer part of the \s-1HTTP\s0 standard.\fR
446 .IP "$h\->referer" 4
447 .IX Item "$h->referer"
448 Used to specify the address (\s-1URI\s0) of the document from which the
449 requested resource address was obtained.
450 .Sp
451 The \*(L"Free On-line Dictionary of Computing\*(R" as this to say about the
452 word \fIreferer\fR:
453 .Sp
454 .Vb 6
455 \&     <World\-Wide Web> A misspelling of "referrer" which
456 \&     somehow made it into the {HTTP} standard.  A given {web
457 \&     page}'s referer (sic) is the {URL} of whatever web page
458 \&     contains the link that the user followed to the current
459 \&     page.  Most browsers pass this information as part of a
460 \&     request.
461 .Ve
462 .Sp
463 .Vb 1
464 \&     (1998\-10\-19)
465 .Ve
466 .Sp
467 By popular demand \f(CW\*(C`referrer\*(C'\fR exists as an alias for this method so you
468 can avoid this misspelling in your programs and still send the right
469 thing on the wire.
470 .Sp
471 When setting the referrer, this method removes the fragment from the
472 given \s-1URI\s0 if it is present, as mandated by \s-1RFC2616\s0.  Note that
473 the removal does \fInot\fR happen automatically if using the \fIheader()\fR,
474 \&\fIpush_header()\fR or \fIinit_header()\fR methods to set the referrer.
475 .IP "$h\->www_authenticate" 4
476 .IX Item "$h->www_authenticate"
477 This header must be included as part of a \f(CW\*(C`401 Unauthorized\*(C'\fR response.
478 The field value consist of a challenge that indicates the
479 authentication scheme and parameters applicable to the requested \s-1URI\s0.
480 .IP "$h\->proxy_authenticate" 4
481 .IX Item "$h->proxy_authenticate"
482 This header must be included in a \f(CW\*(C`407 Proxy Authentication Required\*(C'\fR
483 response.
484 .IP "$h\->authorization" 4
485 .IX Item "$h->authorization"
486 .PD 0
487 .IP "$h\->proxy_authorization" 4
488 .IX Item "$h->proxy_authorization"
489 .PD
490 A user agent that wishes to authenticate itself with a server or a
491 proxy, may do so by including these headers.
492 .IP "$h\->authorization_basic" 4
493 .IX Item "$h->authorization_basic"
494 This method is used to get or set an authorization header that use the
495 \&\*(L"Basic Authentication Scheme\*(R".  In array context it will return two
496 values; the user name and the password.  In scalar context it will
497 return \fI\*(L"uname:password\*(R"\fR as a single string value.
498 .Sp
499 When used to set the header value, it expects two arguments.  \fIE.g.\fR:
500 .Sp
501 .Vb 1
502 \&  $h\->authorization_basic($uname, $password);
503 .Ve
504 .Sp
505 The method will croak if the \f(CW$uname\fR contains a colon ':'.
506 .IP "$h\->proxy_authorization_basic" 4
507 .IX Item "$h->proxy_authorization_basic"
508 Same as \fIauthorization_basic()\fR but will set the \*(L"Proxy\-Authorization\*(R"
509 header instead.
510 .SH "NON-CANONICALIZED FIELD NAMES"
511 .IX Header "NON-CANONICALIZED FIELD NAMES"
512 The header field name spelling is normally canonicalized including the
513 \&'_' to '\-' translation.  There are some application where this is not
514 appropriate.  Prefixing field names with ':' allow you to force a
515 specific spelling.  For example if you really want a header field name
516 to show up as \f(CW\*(C`foo_bar\*(C'\fR instead of \*(L"Foo\-Bar\*(R", you might set it like
517 this:
518 .PP
519 .Vb 1
520 \&  $h\->header(":foo_bar" => 1);
521 .Ve
522 .PP
523 These field names are returned with the ':' intact for
524 \&\f(CW$h\fR\->header_field_names and the \f(CW$h\fR\->scan callback, but the colons do
525 not show in \f(CW$h\fR\->as_string.
526 .SH "COPYRIGHT"
527 .IX Header "COPYRIGHT"
528 Copyright 1995\-2005 Gisle Aas.
529 .PP
530 This library is free software; you can redistribute it and/or
531 modify it under the same terms as Perl itself.