GX::HTTP::Response::Headers - HTTP response headers class
# Load the class use GX::HTTP::Response::Headers; # Create a new headers object $headers = GX::HTTP::Response::Headers->new; # Set the value of a header field $headers->set( 'Content-Type' => 'text/plain' ); # Get the value of a header field $content_type = $headers->get( 'Content-Type' ); # Print the headers print $headers->as_string;
This module provides the GX::HTTP::Response::Headers class which extends the GX::HTTP::Headers class.
new
Returns a new GX::HTTP::Response::Headers object.
$headers = GX::HTTP::Response::Headers->new;
$headers ( GX::HTTP::Response::Headers object )
$headers
GX::Exception
Also see parse().
parse()
add
See "add" in GX::HTTP::Headers.
as_string
See "as_string" in GX::HTTP::Headers.
clear
See "clear" in GX::HTTP::Headers.
count
See "count" in GX::HTTP::Headers.
field_names
See "field_names" in GX::HTTP::Headers.
get
See "get" in GX::HTTP::Headers.
parse
Parses the given message header and adds the resulting header field / value pairs to the container.
$headers->parse( $string );
$string ( string )
$string
This method can also be used as a constructor.
$headers = GX::HTTP::Response::Headers->parse( $string );
remove
See "remove" in GX::HTTP::Headers.
set
See "set" in GX::HTTP::Headers.
sorted_field_names
See "sorted_field_names" in GX::HTTP::Headers.
content_disposition
See "content_disposition" in GX::HTTP::Headers.
content_encoding
See "content_encoding" in GX::HTTP::Headers.
content_language
See "content_language" in GX::HTTP::Headers.
content_length
See "content_length" in GX::HTTP::Headers.
content_type
See "content_type" in GX::HTTP::Headers.
date
See "date" in GX::HTTP::Headers.
expires
See "expires" in GX::HTTP::Headers.
last_modified
See "last_modified" in GX::HTTP::Headers.
location
Returns / sets the value of the "Location" header field.
$value = $headers->location; $value = $headers->location( $value );
$value ( string | undef ) [ optional ]
$value
undef
$value ( string | undef )
See RFC 2616, section 14.30.
set_cookie
Returns / sets the value of the "Set-Cookie" header field.
$value = $headers->set_cookie; $value = $headers->set_cookie( $value );
See RFC 2109, section 4.2.2.
Jörg A. Uzarek <uzarek@runlevelnull.de>
Copyright (c) 2009-2011 Jörg A. Uzarek.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.
To install GX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GX
CPAN shell
perl -MCPAN -e shell install GX
For more information on module installation, please visit the detailed CPAN module installation guide.