NAME
AnyEvent::HTTP::Response - HTTP Response object for AnyEvent::HTTP
VERSION
version 0.100
SYNOPSIS
# named arguments (via hashref):
AnyEvent::HTTP::Request->new({
body => $body,
headers => \%headers,
pseudo_headers => \%pseudo,
});
# argument list like the callback for AnyEvent::HTTP::http_request
AnyEvent::HTTP::Request->new($body, \%headers);
DESCRIPTION
This object represents an HTTP response from AnyEvent::HTTP.
This is a companion class to AnyEvent::HTTP::Request.
CLASS METHODS
new
See "SYNOPSIS" for usage example.
Accepts a list of arguments (like those that would be passed to the callback in "http_request" in AnyEvent::HTTP) which will be passed through "parse_args".
Alternatively a single hashref can be passed with anything listed in "ATTRIBUTES" as the keys.
parse_args
Called by the constructor to parse the argument list passed to the callback in "http_request" in AnyEvent::HTTP and return a hashref which will be the basis for the object.
The list should look like ($body, \%headers)
.
This will separate the "pseudo" headers from the regular http headers as described by "http_request" in AnyEvent::HTTP (http headers are lower-cased and pseudo headers start with an upper case letter).
ATTRIBUTES
body
Response content body
content
Alias for "body"
headers
HTTP Response headers
pseudo_headers
A hashref of extra fields that "http_request" in AnyEvent::HTTP returns with the http headers (the ones that start with an upper-case letter... Status, Reason, etc).
METHODS
args
Returns a list of arguments like those passed to the callback in "http_request" in AnyEvent::HTTP.
TODO
Provide conversion to/from more featureful HTTP::Response
SEE ALSO
AnyEvent::HTTP::Message (base class)
AUTHOR
Randy Stauner <rwstauner@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Randy Stauner.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.