HTTP::Promise::Headers::Cookie - Cookie Header Field
use HTTP::Promise::Headers::Cookie; my $c = HTTP::Promise::Headers::Cookie->new( 'name=value; name2=value2; name3=value3' ) || die( HTTP::Promise::Headers::Cookie->error, "\n" ); # or my $c = HTTP::Promise::Headers::Cookie->new( [qw( name=value name2=value2 name3=value3 )] ); $c->cookies->push( 'name4=value4' ); $c->cookies->remove( 'name2=value2' ); say "$c"; # This would return: name=value; name3=value3; name4=value4
v0.1.0
HTTP::Promise::Headers::Cookie implements a simple interface to store the cookie name-value pairs sent by the user agent to the server. It uses "cookies" which returns a Module::Generic::Array to manage and contain all the cookie name-value pairs. It is up to you to provide the right cookie string.
You can and maybe should use Cookie::Jar to help you manage a cookie jar and format cookies.
Provided with an optional string or array reference and this will instantiate a new object and return it.
If a string is provided, it is expected to be properly formatted, such as:
name=value; name2=value2; name3=value3
It will be properly split and added to "cookies". If an array is provided, it will be directly added to "cookies".
Returns a string representation for this Cookie header field.
Cookie
Returns an array object containing all the cookies.
Jacques Deguest <jack@deguest.jp>
Cookie, Cookie::Jar, rfc6265, section 5.4 and 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(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.
To install HTTP::Promise, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::Promise
CPAN shell
perl -MCPAN -e shell install HTTP::Promise
For more information on module installation, please visit the detailed CPAN module installation guide.