NAME

HTTP::Promise::Headers::AcceptEncoding - Accept Encoding Header Field

SYNOPSIS

use HTTP::Promise::Headers::AcceptEncoding;
my $ac = HTTP::Promise::Headers::AcceptEncoding->new || 
    die( HTTP::Promise::Headers::AcceptEncoding->error, "\n" );
my $ac = HTTP::Promise::Headers::AcceptEncoding->new( 'deflate, gzip;q=1.0, *;q=0.5' ) || 
    die( HTTP::Promise::Headers::AcceptEncoding->error, "\n" );
$ac->add( 'br' );
$ac->add( 'gzip' => 0.7 );
$h->accept( $ac->as_string ); Accept: br, gzip;q=0.7
# or
$h->accept( "$ac" );
my $qv_elements = $ac->elements;
my $obj = $ac->get( 'br' );
# change the weight
$obj->value( 0.3 );
$ac->remove( 'br' );
my $sorted_objects = $ac->sort;
my $asc_sorted = $ac->sort(1);
# Returns a Module::Generic::Array object
my $ok = $ac->match( [qw( br gzip )] );

VERSION

v0.1.0

DESCRIPTION

This class inherits all its features and methods from HTTP::Promise::Headers::Accept

The following description is taken from Mozilla documentation.

Accept-Encoding: gzip
Accept-Encoding: compress
Accept-Encoding: deflate
Accept-Encoding: br
Accept-Encoding: identity
Accept-Encoding: *

// Multiple algorithms, weighted with the quality value syntax:
Accept-Encoding: deflate, gzip;q=1.0, *;q=0.5
Accept-Encoding: br;q=1.0, gzip;q=0.8, *;q=0.1
Accept-Encoding: gzip, compress, br

METHODS

See HTTP::Promise::Headers::Accept

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla documentation

HTTP::Promise, HTTP::Promise::Request, HTTP::Promise::Response, HTTP::Promise::Message, HTTP::Promise::Entity, HTTP::Promise::Headers, HTTP::Promise::Body, HTTP::Promise::Body::Form, HTTP::Promise::Body::Form::Data, HTTP::Promise::Body::Form::Field, HTTP::Promise::Status, HTTP::Promise::MIME, HTTP::Promise::Parser, HTTP::Promise::IO, HTTP::Promise::Stream, HTTP::Promise::Exception

COPYRIGHT & LICENSE

Copyright(c) 2022 DEGUEST Pte. Ltd.

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.