Sync from SUSE:SLFO:Main perl-HTTP-Message revision 9c781d058c34644ae61b3f398d2d097e

This commit is contained in:
Adrian Schröter 2024-05-03 18:22:27 +02:00
commit a83b6a528b
5 changed files with 848 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
HTTP-Message-6.44.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

23
cpanspec.yml Normal file
View File

@ -0,0 +1,23 @@
---
#description_paragraphs: 3
#no_testing: broken upstream
#sources:
# - source1
# - source2
#patches:
# foo.patch: -p1
# bar.patch:
#preamble: |-
# BuildRequires: gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module

397
perl-HTTP-Message.changes Normal file
View File

@ -0,0 +1,397 @@
-------------------------------------------------------------------
Thu Oct 27 03:07:31 UTC 2022 - Tina Müller <timueller+perl@suse.de>
- updated to 6.44
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.44 2022-10-26 20:49:00Z
- Made the Clone module a hard requirement, so we don't have to
provide a fallback function for HTTP::Headers::clone().
We require at least Clone 0.46, as that release now supports
Perl back to 5.8.1, just like us. (GH#184) (Neil Bowers)
- Import clone from Clone rather than inheriting (GH#189) (Graham Knop)
- Made the Compress::Raw::Zlib 2.062 module minimal required
version. (GH#190) (Jakub 'q84fh' Skory)
6.43 2022-10-22 14:50:35Z
- Remove dependency to IO::Uncompress::Bunzip2. (Michal Josef Spacek)
- Remove dependency to IO::Uncompress::Gunzip. (Michal Josef Spacek)
6.42 2022-10-18 13:53:22Z
- We now don't consider the Content-Location header when asked
for the base URI. RFC 7231 says we shouldn't. (GH#51) (Neil Bowers)
- Increased the (max) buffer size for read() when processing form data,
from 2048 to 8192. This was suggested in RT#105184, as it improved
performance for them. (GH#59) (Neil Bowers)
-------------------------------------------------------------------
Thu Oct 13 03:08:25 UTC 2022 - Tina Müller <timueller+perl@suse.de>
- updated to 6.41
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.41 2022-10-12 15:57:40Z
- Add maximum size for HTTP::Message->decoded_content
This can be used to limit the size of a decompressed HTTP response,
especially when making requests to untrusted or user-specified servers.
The $HTTP::Message::MAXIMUM_BODY_SIZE variable and the ->max_body_size
accessor can set this limit. (GH#181) (Max Maischein)
6.40 2022-10-12 15:45:52Z
- Fixed two typos in the doc, originally reported by FatherC
in RT#90716, ported over as GH#57. (GH#57) (Neil Bowers)
6.39 2022-10-08 13:48:26Z
- Remove Travis config (GH#180) (Olaf Alders)
- Added status_constant_name() which maps status code
to the name of the corresponding constant. (GH#160) (Neil Bowers)
- Updated the doc for status_message() to clarify that it
returns "Not Found" and not "HTTP_NOT_FOUND". (GH#160) (Neil Bowers)
6.38 2022-10-06 21:48:18Z
- Replace "base" with "parent" (GH#176) (James Raspass)
- Replace "print" with "note" in tests (GH#178) (James Raspass)
- Noted that OPTIONS supported was added in 6.1, to the doc
for HTTP::Request::Common. Addresses GH#177. (GH#179) (Neil Bowers)
-------------------------------------------------------------------
Wed Jun 15 03:06:33 UTC 2022 - Tina Müller <timueller+perl@suse.de>
- updated to 6.37
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.37 2022-06-14 14:08:55Z
- Support for Brotli "br" encoding (GH#163) (trizen and Julien Fiegehenn)
- Don't test Perl > 5.32 on Windows in GH Actions (GH#174) (Olaf Alders)
-------------------------------------------------------------------
Thu Jan 6 03:06:20 UTC 2022 - Tina Müller <timueller+perl@suse.de>
- updated to 6.36
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.36 2022-01-05 14:39:42Z
- Fix examples in HTTP::Request::Common synopsis: HTTP::Request::Common
does not put headers in an arrayref, unlike HTTP::Request (GH#170) (Karen
Etheridge)
- Update to contributing information (GH#171) (Håkon Hægland)
-------------------------------------------------------------------
Fri Nov 12 03:06:15 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.35
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.35 2021-11-11 22:10:31Z
- Clarify documentation for decoded_content (GH#166) (Eric Wastl)
-------------------------------------------------------------------
Tue Nov 9 03:06:22 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.34
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.34 2021-11-08 14:27:36Z
- Catch case of empty name/value in header words split. (GH#168) (Galen Huntington)
-------------------------------------------------------------------
Tue Jun 29 03:06:46 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.33
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.33 2021-06-28 16:51:58Z
- Allow `can` method to respond to delegated methods (GH#159) (nanto_vi,
TOYAMA Nao)
-------------------------------------------------------------------
Wed May 19 03:08:43 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.32
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.32 2021-05-18 18:54:27Z
- Use File::Spec for MSWin32 on Content-Disposition filename (GH#157)
(tzccinct)
-------------------------------------------------------------------
Wed May 12 03:07:40 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.31
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.31 2021-05-11 18:07:37Z
- Fix test writing to files (GH#156) (Michal Josef Špaček)
6.30 2021-05-10 14:55:55Z
- Don't inherit from Exporter anymore (GH#155) (Max Maischein)
- Remove superfluous Perl version requirement. This module requires Perl
5.6 or newer. (GH#155) (Max Maischein)
-------------------------------------------------------------------
Sun Mar 7 03:06:30 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.29
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.29 2021-03-06 04:50:34Z
- fix issue with HTTP::Request internal cache for canonical url when using
URI::URL (GH#146) (andrew-grechkin)
-------------------------------------------------------------------
Mon Feb 22 16:45:52 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.28
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.28 2021-02-19 16:22:13Z
- fix warnings during HTTP::Config->match #62 (GH#152) (Viťas Strádal)
-------------------------------------------------------------------
Wed Jan 6 03:06:58 UTC 2021 - Tina Müller <timueller+perl@suse.de>
- updated to 6.27
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.27 2021-01-05 03:02:01Z
- Clean up backcompat code (GH#148) (Dan Book)
- Add "308 Permanent Redirect" to is_cacheable_by_default (GH#150) (simbabque)
-------------------------------------------------------------------
Fri Sep 11 03:07:40 UTC 2020 - Tina Müller <timueller+perl@suse.de>
- updated to 6.26
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.26 2020-09-10 02:34:25Z
- Update comment which explains in which RFC 451 is defined (GH#143) (Olaf
Alders). Reported by Toby Inkster.
- Fix HTTP status descriptions and add 425 Too Early (GH#145) (Dan Book)
-------------------------------------------------------------------
Mon Jun 29 03:09:15 UTC 2020 - Tina Müller <timueller+perl@suse.de>
- updated to 6.25
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.25 2020-06-28 17:52:12Z
- Don't run Changes test on master in GH actions
- move Clone from required to suggests prerequisite, to re-enable
fatpacking
-------------------------------------------------------------------
Tue May 12 03:09:10 UTC 2020 - Tina Müller <timueller+perl@suse.de>
updated to 6.24
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.24 2020-05-11 13:15:25Z
- Full release. No changes since TRIAL release 6.23
6.23 2020-05-07 17:57:18Z (TRIAL RELEASE)
- Enable static install (GH#134) (Olaf Alders)
- Support non-string header values that stringify (GH#137) (Will Storey)
-------------------------------------------------------------------
Tue Feb 25 03:07:45 UTC 2020 - <timueller+perl@suse.de>
- updated to 6.22
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.22 2020-02-24 18:58:07Z
- Full release. No changes since TRIAL release 6.21
6.21 2020-02-19 14:35:09Z (TRIAL RELEASE)
- Bump Encode to latest version (3.01) (GH#129) (Olaf Alders)
- Revert #115 (GH#131) (Olaf Alders)
- Revert (GH#125) "try hard to make a usable file name" (GH#130) (Olaf
Alders)
- Fix JSON request encoding examples in POD (GH#126) (Michael Schout)
6.20 2019-02-05 01:46:39Z (TRIAL RELEASE)
- Fix encoded file names when LC_ALL=C (GH#125) (Lars Dɪ 迪拉斯)
6.19 2019-01-16 15:17:35Z (TRIAL RELEASE)
- Add support for RFC 8187 encoded filenames (GH#115) (Zaki Mughal)
- Fix memoized _uri_canonical #121 (GH#123) (Dorian Taylor)
- Don't overwrite $@ in decodable (gh #80) (GH#118) (mschae94)
- Add support for RFC 8187 encoded filenames (GH#115) (Zaki Mughal)
-------------------------------------------------------------------
Wed Jun 6 05:30:44 UTC 2018 - coolo@suse.com
- updated to 6.18
see /usr/share/doc/packages/perl-HTTP-Message/Changes
-------------------------------------------------------------------
Thu Mar 29 05:25:35 UTC 2018 - coolo@suse.com
- updated to 6.16
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.16 2018-03-28 14:09:17Z
- Update status codes to official IANA list (GH#100) (Theo van Hoesel)
-------------------------------------------------------------------
Wed Mar 14 06:24:08 UTC 2018 - coolo@suse.com
- updated to 6.15
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.15 2018-03-13 13:02:56Z
- Whenever possible, use an absolute four digit year for Time::Local (GH#97)
- Add is_cacheable_by_default() (GH#98) (Theo van Hoesel)
-------------------------------------------------------------------
Fri Jan 5 13:18:30 UTC 2018 - pmonrealgonzalez@suse.com
- updated to 6.14
- Add some useful examples in HTTP::Request (GH #92)
Batch requests are now explained.
- PUT and PATCH docs updated (GH #84)
- Trim trailing "\r" from status line so message() doesn't
return it (GH #87)
- Bring test coverage of HTTP::Config to 100% (GH #85)
- Add 103 Early Hints to HTTP::Status (GH #94)
-------------------------------------------------------------------
Wed Jun 21 05:46:21 UTC 2017 - coolo@suse.com
- updated to 6.13
see /usr/share/doc/packages/perl-HTTP-Message/Changes
-------------------------------------------------------------------
Thu Sep 10 09:44:07 UTC 2015 - coolo@suse.com
- updated to 6.11
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.11 2015-09-09
- fix an undefined value warning in HTTP::Headers::as_string
-------------------------------------------------------------------
Mon Jul 20 08:49:19 UTC 2015 - coolo@suse.com
- updated to 6.10
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.10 2015-07-19
- fix uses of qr/.../m in tests that do not work in 5.8.x
-------------------------------------------------------------------
Sun Jul 19 08:54:05 UTC 2015 - coolo@suse.com
- updated to 6.09
see /usr/share/doc/packages/perl-HTTP-Message/Changes
6.09 2015-07-19
- converted all uses of Test.pm to Test::More
- fix uninitialized warning in HTTP::Config (RT#105929)
-------------------------------------------------------------------
Mon Jul 13 08:40:20 UTC 2015 - coolo@suse.com
- updated to 6.08
see /usr/share/doc/packages/perl-HTTP-Message/Changes
Revision history for HTTP-Message
6.08 2015-07-10
- Resolve new uninitialized warning from
HTTP::Request::Common::request_type_with_data (RT#105787)
6.07 2015-07-09
- Allow subclasses to override the class of parts - it used to be
hardcoded to HTTP::Message. (Gisle Aas, RT#79239)
- Added support for is_client_error, is_server_error to HTTP::Response
(Karen Etheridge)
- Added flatten interface to HTTP::Headers (Tokuhiro Matsuno, GH#5)
- Allow PUT to pass content data via hashrefs just like with POST (Michael
Schilli, GH#9)
- Fix for "Content-Encoding: none" header (Gisle Aas, RT#94882)
- Add support for HTTP status 308, defined in RFC 7238 (Olivier Mengué,
RT#104102)
- drop the use of "use vars" (Karen Etheridge)
-------------------------------------------------------------------
Mon Aug 5 09:02:46 UTC 2013 - coolo@suse.com
- updated to 6.06
Gisle Aas (2):
More forgiving test on croak message [RT#80302]
Added test for multipart parsing
Mark Overmeer (1):
Multipart end boundary doesn't need match a complete line [RT#79239]
2012-10-20 HTTP-Message 6.05
Gisle Aas (5):
Updated ignores
No need to prevent visiting field values starting with '_'
Report the correct croak caller for delegated methods
Disallow empty field names or field names containing ':'
Make the extra std_case entries local to each header
2012-09-30 HTTP-Message 6.04
Gisle Aas (5):
Updated repository URL
Avoid undef warning for empty content
Teach $m->content_charset about JSON
Use the canonical charset name for UTF-16LE (and frieds)
Add option to override the "(no content)" marker of $m->dump
Christopher J. Madsen (2):
Use IO::HTML for <meta> encoding sniffing
mime_name was introduced in Encode 2.21
Tom Hukins (1):
Remove an unneeded "require"
Ville Skyttä (1):
Spelling fixes.
chromatic (1):
Sanitized PERL_HTTP_URI_CLASS environment variable.
Martin H. Sluka (1):
Add test from RT#77466
Father Chrysostomos (1):
Fix doc grammo [RT#75831]
-------------------------------------------------------------------
Mon Apr 15 10:53:01 UTC 2013 - idonmez@suse.com
- Add Source URL, see https://en.opensuse.org/SourceUrls
-------------------------------------------------------------------
Thu Mar 31 18:39:23 UTC 2011 - coolo@novell.com
- update to 6.02
Declare dependency on Bunzip2 v2.021 [RT#66593]
-------------------------------------------------------------------
Wed Mar 16 23:30:10 UTC 2011 - chris@computersalat.de
- fix deps
o perl(Encode), perl(IO::Compress::Bzip2) and other subs,
o perl(MIME::Base64), perl(MIME::QuotedPrint)
-------------------------------------------------------------------
Mon Mar 14 10:17:03 UTC 2011 - vcizek@novell.com
- initial package 6.01
* created by cpanspec 1.78.03

402
perl-HTTP-Message.spec Normal file
View File

@ -0,0 +1,402 @@
#
# spec file for package perl-HTTP-Message
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name HTTP-Message
Name: perl-HTTP-Message
Version: 6.44
Release: 0
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: HTTP style message (base class)
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Clone) >= 0.46
BuildRequires: perl(Compress::Raw::Bzip2)
BuildRequires: perl(Compress::Raw::Zlib) >= 2.062
BuildRequires: perl(Encode) >= 3.01
BuildRequires: perl(Encode::Locale) >= 1
BuildRequires: perl(HTTP::Date) >= 6
BuildRequires: perl(IO::Compress::Bzip2) >= 2.021
BuildRequires: perl(IO::Compress::Deflate)
BuildRequires: perl(IO::Compress::Gzip)
BuildRequires: perl(IO::HTML)
BuildRequires: perl(IO::Uncompress::Inflate)
BuildRequires: perl(IO::Uncompress::RawInflate)
BuildRequires: perl(LWP::MediaTypes) >= 6
BuildRequires: perl(Test::More) >= 0.88
BuildRequires: perl(Test::Needs)
BuildRequires: perl(Try::Tiny)
BuildRequires: perl(URI) >= 1.10
BuildRequires: perl(URI::URL)
BuildRequires: perl(parent)
Requires: perl(Clone) >= 0.46
Requires: perl(Compress::Raw::Bzip2)
Requires: perl(Compress::Raw::Zlib) >= 2.062
Requires: perl(Encode) >= 3.01
Requires: perl(Encode::Locale) >= 1
Requires: perl(HTTP::Date) >= 6
Requires: perl(IO::Compress::Bzip2) >= 2.021
Requires: perl(IO::Compress::Deflate)
Requires: perl(IO::Compress::Gzip)
Requires: perl(IO::HTML)
Requires: perl(IO::Uncompress::Inflate)
Requires: perl(IO::Uncompress::RawInflate)
Requires: perl(LWP::MediaTypes) >= 6
Requires: perl(URI) >= 1.10
Requires: perl(parent)
Recommends: perl(IO::Compress::Brotli) >= 0.004001
Recommends: perl(IO::Uncompress::Brotli) >= 0.004001
%{perl_requires}
%description
An 'HTTP::Message' object contains some headers and a content body. The
following methods are available:
* $mess = HTTP::Message->new
* $mess = HTTP::Message->new( $headers )
* $mess = HTTP::Message->new( $headers, $content )
This constructs a new message object. Normally you would want construct
'HTTP::Request' or 'HTTP::Response' objects instead.
The optional $header argument should be a reference to an 'HTTP::Headers'
object or a plain array reference of key/value pairs. If an 'HTTP::Headers'
object is provided then a copy of it will be embedded into the constructed
message, i.e. it will not be owned and can be modified afterwards without
affecting the message.
The optional $content argument should be a string of bytes.
* $mess = HTTP::Message->parse( $str )
This constructs a new message object by parsing the given string.
* $mess->headers
Returns the embedded 'HTTP::Headers' object.
* $mess->headers_as_string
* $mess->headers_as_string( $eol )
Call the as_string() method for the headers in the message. This will be
the same as
$mess->headers->as_string
but it will make your program a whole character shorter :-)
* $mess->content
* $mess->content( $bytes )
The content() method sets the raw content if an argument is given. If no
argument is given the content is not touched. In either case the original
raw content is returned.
If the 'undef' argument is given, the content is reset to its default
value, which is an empty string.
Note that the content should be a string of bytes. Strings in perl can
contain characters outside the range of a byte. The 'Encode' module can be
used to turn such strings into a string of bytes.
* $mess->add_content( $bytes )
The add_content() methods appends more data bytes to the end of the current
content buffer.
* $mess->add_content_utf8( $string )
The add_content_utf8() method appends the UTF-8 bytes representing the
string to the end of the current content buffer.
* $mess->content_ref
* $mess->content_ref( \$bytes )
The content_ref() method will return a reference to content buffer string.
It can be more efficient to access the content this way if the content is
huge, and it can even be used for direct manipulation of the content, for
instance:
${$res->content_ref} =~ s/\bfoo\b/bar/g;
This example would modify the content buffer in-place.
If an argument is passed it will setup the content to reference some
external source. The content() and add_content() methods will automatically
dereference scalar references passed this way. For other references
content() will return the reference itself and add_content() will refuse to
do anything.
* $mess->content_charset
This returns the charset used by the content in the message. The charset is
either found as the charset attribute of the 'Content-Type' header or by
guessing.
See http://www.w3.org/TR/REC-html40/charset.html#spec-char-encoding for
details about how charset is determined.
* $mess->decoded_content( %options )
Returns the content with any 'Content-Encoding' undone and, for textual
content ('Content-Type' values starting with 'text/', exactly matching
'application/xml', or ending with '+xml'), the raw content's character set
decoded into Perl's Unicode string format. Note that this at
https://github.com/libwww-perl/HTTP-Message/pull/99 attempt to decode
declared character sets for any other content types like 'application/json'
or 'application/javascript'. If the 'Content-Encoding' or 'charset' of the
message is unknown, this method will fail by returning 'undef'.
The following options can be specified.
* 'charset'
This overrides the charset parameter for text content. The value 'none' can
used to suppress decoding of the charset.
* 'default_charset'
This overrides the default charset guessed by content_charset() or if that
fails "ISO-8859-1".
* 'alt_charset'
If decoding fails because the charset specified in the Content-Type header
isn't recognized by Perl's Encode module, then try decoding using this
charset instead of failing. The 'alt_charset' might be specified as 'none'
to simply return the string without any decoding of charset as alternative.
* 'charset_strict'
Abort decoding if malformed characters is found in the content. By default
you get the substitution character ("\x{FFFD}") in place of malformed
characters.
* 'raise_error'
If TRUE then raise an exception if not able to decode content. Reason might
be that the specified 'Content-Encoding' or 'charset' is not supported. If
this option is FALSE, then decoded_content() will return 'undef' on errors,
but will still set $@.
* 'ref'
If TRUE then a reference to decoded content is returned. This might be more
efficient in cases where the decoded content is identical to the raw
content as no data copying is required in this case.
* $mess->decodable
* HTTP::Message::decodable()
This returns the encoding identifiers that decoded_content() can process.
In scalar context returns a comma separated string of identifiers.
This value is suitable for initializing the 'Accept-Encoding' request
header field.
* $mess->decode
This method tries to replace the content of the message with the decoded
version and removes the 'Content-Encoding' header. Returns TRUE if
successful and FALSE if not.
If the message does not have a 'Content-Encoding' header this method does
nothing and returns TRUE.
Note that the content of the message is still bytes after this method has
been called and you still need to call decoded_content() if you want to
process its content as a string.
* $mess->encode( $encoding, ... )
Apply the given encodings to the content of the message. Returns TRUE if
successful. The "identity" (non-)encoding is always supported; other
currently supported encodings, subject to availability of required
additional modules, are "gzip", "deflate", "x-bzip2", "base64" and "br".
A successful call to this function will set the 'Content-Encoding' header.
Note that 'multipart/*' or 'message/*' messages can't be encoded and this
method will croak if you try.
* $mess->parts
* $mess->parts( @parts )
* $mess->parts( \@parts )
Messages can be composite, i.e. contain other messages. The composite
messages have a content type of 'multipart/*' or 'message/*'. This method
give access to the contained messages.
The argumentless form will return a list of 'HTTP::Message' objects. If the
content type of $msg is not 'multipart/*' or 'message/*' then this will
return the empty list. In scalar context only the first object is returned.
The returned message parts should be regarded as read-only (future versions
of this library might make it possible to modify the parent by modifying
the parts).
If the content type of $msg is 'message/*' then there will only be one part
returned.
If the content type is 'message/http', then the return value will be either
an 'HTTP::Request' or an 'HTTP::Response' object.
If a @parts argument is given, then the content of the message will be
modified. The array reference form is provided so that an empty list can be
provided. The @parts array should contain 'HTTP::Message' objects. The
@parts objects are owned by $mess after this call and should not be
modified or made part of other messages.
When updating the message with this method and the old content type of
$mess is not 'multipart/*' or 'message/*', then the content type is set to
'multipart/mixed' and all other content headers are cleared.
This method will croak if the content type is 'message/*' and more than one
part is provided.
* $mess->add_part( $part )
This will add a part to a message. The $part argument should be another
'HTTP::Message' object. If the previous content type of $mess is not
'multipart/*' then the old content (together with all content headers) will
be made part #1 and the content type made 'multipart/mixed' before the new
part is added. The $part object is owned by $mess after this call and
should not be modified or made part of other messages.
There is no return value.
* $mess->clear
Will clear the headers and set the content to the empty string. There is no
return value
* $mess->protocol
* $mess->protocol( $proto )
Sets the HTTP protocol used for the message. The protocol() is a string
like 'HTTP/1.0' or 'HTTP/1.1'.
* $mess->clone
Returns a copy of the message object.
* $mess->as_string
* $mess->as_string( $eol )
Returns the message formatted as a single string.
The optional $eol parameter specifies the line ending sequence to use. The
default is "\n". If no $eol is given then as_string will ensure that the
returned string is newline terminated (even when the message content is
not). No extra newline is appended if an explicit $eol is passed.
* $mess->dump( %opt )
Returns the message formatted as a string. In void context print the
string.
This differs from '$mess->as_string' in that it escapes the bytes of the
content so that it's safe to print them and it limits how much content to
print. The escapes syntax used is the same as for Perl's double quoted
strings. If there is no content the string "(no content)" is shown in its
place.
Options to influence the output can be passed as key/value pairs. The
following options are recognized:
* maxlength => $num
How much of the content to show. The default is 512. Set this to 0 for
unlimited.
If the content is longer then the string is chopped at the limit and the
string "...\n(### more bytes not shown)" appended.
* no_content => $str
Replaces the "(no content)" marker.
* prefix => $str
A string that will be prefixed to each line of the dump.
All methods unknown to 'HTTP::Message' itself are delegated to the
'HTTP::Headers' object that is part of every message. This allows
convenient access to these methods. Refer to HTTP::Headers for details of
these methods:
$mess->header( $field => $val )
$mess->push_header( $field => $val )
$mess->init_header( $field => $val )
$mess->remove_header( $field )
$mess->remove_content_headers
$mess->header_field_names
$mess->scan( \&doit )
$mess->date
$mess->expires
$mess->if_modified_since
$mess->if_unmodified_since
$mess->last_modified
$mess->content_type
$mess->content_encoding
$mess->content_length
$mess->content_language
$mess->title
$mess->user_agent
$mess->server
$mess->from
$mess->referer
$mess->www_authenticate
$mess->authorization
$mess->proxy_authorization
$mess->authorization_basic
$mess->proxy_authorization_basic
%prep
%autosetup -n %{cpan_name}-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes CONTRIBUTING.md CONTRIBUTORS README.md
%license LICENSE
%changelog