GX::HTTP::Message - HTTP message base class
None.
This module provides the GX::HTTP::Message class which extends the GX::Class::Object class.
This class is not meant to be instantiated. See GX::HTTP::Request and GX::HTTP::Response instead.
add
Adds the given content to the message body.
$message->add( @content );
@content ( scalars )
@content
byte strings
references to byte strings
references to subroutines returning byte strings
IO::Handle objects / GLOB references to read() bytes from
GLOB
read()
GX::Exception
This method is a shortcut for calling $message->body->add().
$message->body->add()
as_string
Returns the message as a string of bytes.
$string = $message->as_string;
$string ( string )
$string
body
Returns / sets the GX::HTTP::Body object containing the message body.
$body = $message->body; $body = $message->body( $body );
$body ( GX::HTTP::Body object ) [ optional ]
$body
$body ( GX::HTTP::Body object )
content_encoding
Returns / sets the value of the "Content-Encoding" message header field.
$content_encoding = $message->content_encoding; $content_encoding = $message->content_encoding( $content_encoding );
$content_encoding ( string | undef ) [ optional ]
$content_encoding
undef
$content_encoding ( string | undef )
This method is a shortcut for calling $message->headers->content_encoding().
$message->headers->content_encoding()
content_length
Returns / sets the value of the "Content-Length" message header field.
$content_length = $message->content_length; $content_length = $message->content_length( $content_length );
$content_length ( string | undef ) [ optional ]
$content_length
$content_length ( string | undef )
This method is a shortcut for calling $message->headers->content_length().
$message->headers->content_length()
content_type
Returns / sets the value of the "Content-Type" message header field.
$content_type = $message->content_type; $content_type = $message->content_type( $content_type );
$content_type ( string | undef ) [ optional ]
$content_type
$content_type ( string | undef )
This method is a shortcut for calling $message->headers->content_type().
$message->headers->content_type()
header
Returns / sets the value of the specified message header field.
$value = $message->header( $field ); $value = $message->header( $field, $value );
$field ( string )
$field
$value ( string | undef ) [ optional ]
$value
$value ( string | undef )
This method is a shortcut for calling $message->headers->get() and $message->headers->set() respectively.
$message->headers->get()
$message->headers->set()
headers
Returns / sets the container for the message headers.
$headers = $message->headers; $headers = $message->headers( $headers );
$headers ( GX::HTTP::Headers object ) [ optional ]
$headers
$headers ( GX::HTTP::Headers object )
print
An alias for the add() method.
add()
$message->print( @content );
print_to
Prints the message to the specified filehandle, returning true on success and false on failure.
$result = $message->print_to( $handle );
$handle ( IO::File object | typeglob | GLOB reference )
$handle
$result ( bool )
$result
protocol
Returns / sets the HTTP version.
$protocol = $message->protocol; $protocol = $message->protocol( $protocol );
$protocol ( string | undef ) [ optional ]
$protocol
$protocol ( string | undef )
The following classes inherit directly from GX::HTTP::Message:
GX::HTTP::Request
GX::HTTP::Response
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.