NAME
HTTP::Promise::Headers::AcceptLanguage - Accept-Language Header Field
SYNOPSIS
use HTTP::Promise::Headers::AcceptLanguage;
my $ac = HTTP::Promise::Headers::AcceptLanguage->new ||
die( HTTP::Promise::Headers::AcceptLanguage->error, "\n" );
my $ac = HTTP::Promise::Headers::AcceptLanguage->new( 'fr-FR, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5' ) ||
die( HTTP::Promise::Headers::AcceptLanguage->error, "\n" );
$ac->add( fr' );
$ac->add( 'ja-JP' => 0.7 );
$h->accept( $ac->as_string ); Accept: fr, ja-JP;q=0.7
# or
$h->accept( "$ac" );
my $qv_elements = $ac->elements;
my $obj = $ac->get( 'ja-JP' );
# change the weight
$obj->value( 0.3 );
$ac->remove( 'fr' );
my $sorted_objects = $ac->sort;
my $asc_sorted = $ac->sort(1);
# Returns a Module::Generic::Array object
my $ok = $ac->match( [qw( fr ja-JP en en-GB en-US )] );
VERSION
v0.1.0
DESCRIPTION
This class inherits all its features from HTTP::Promise::Headers::Accept
The following description is taken from Mozilla documentation.
Accept-Language: da, en-gb;q=0.8, en;q=0.7
Accept-Language: fr-FR, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5
METHODS
See HTTP::Promise::Headers::Accept
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
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.