AMF-Connection
view release on metacpan or search on metacpan
{
"abstract" : "A simple library to write AMF clients.",
"author" : [
"Alberto Attilio Reggiori, <areggiori@cpan.org>"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
---
abstract: 'A simple library to write AMF clients.'
author:
- 'Alberto Attilio Reggiori, <areggiori@cpan.org>'
build_requires:
ExtUtils::MakeMaker: 0
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
examples/get-brightcove-videos-metadata.pl view on Meta::CPAN
'flex.messaging.io.ArrayCollection'
);
}
my $endpoint = 'http://c.brightcove.com/services/amfgateway';
my $service = 'com.brightcove.templating.TemplatingFacade';
my $method = 'getContentForTemplateInstance';
my $client = new AMF::Connection( $endpoint );
# $client->config( ... ); # LWP::UserAgent extra params (proxy, auth etc... )
#$client->setEncoding(3);
#$client->setHTTPProxy('http://127.0.0.1:8888');
#$client->setHTTPCookieJar( HTTP::Cookies->new(file => "/tmp/lwpcookies.txt", autosave => 1, ignore_discard => 1 ) );
# eg taken from http://link.brightcove.com/services/player/bcpid34762914001?bctid=672454611001
# works only with AMF0 encoding - at least it seems so - because using openamf ?
#
my $player_id = '34762914001';
my $videoId = '672454611001';
lib/AMF/Connection.pm view on Meta::CPAN
'encoding' => 0, # default is AMF0 encoding
'ua' => new LWP::UserAgent(),
'append_to_endpoint' => ''
};
$self->{'ua'}->cookie_jar( $self->{'http_cookie_jar'} );
return bless($self, $class);
};
# plus add paramters, referer, user agent, authentication/credentials ( see also SecureAMFChannel stuff ),
# plus timezone on retunred dates to pass to de-serializer - see AMF3 spec saying "it is suggested that time zone be queried independnetly as needed" - unelss local DateTime default to right locale!
# we pass the string, and let Storable::AMF to parse the options into a scalar - see Input/OutputStream and Storable::AMF0 documentation
sub setInputAMFOptions {
my ($class, $options) = @_;
$class->{'input_amf_options'} = $options;
};
lib/AMF/Connection.pm view on Meta::CPAN
=head1 DATE TYPE SUPPORT
The latest 0.79 version of Storable::AMF added basic date support with the new_date() and perl_date() utilitiy functions. This is just great. Internally an AMF Date Type represents a timestamp in milliseconds since the epoch in UTC ("neutral") timezo...
use Storable::AMF qw(new_date perl_date);
and make sure any date passed to an AMF::Connection as parameter is encoded with new_date().
=head2 OPEN ISSUES AND SHORTCOMINGS
There is still an issue when arbitrary Date structures are returned from an AMF server to an AMF::Connection (E.g. as part of values of structured AMF Objects). In this case, the AMF::Connection does not try to reparse the Perl object structure retur...
All this means that an AMF::Connection client application can not rely on those Date returned by the server as being Perl timestamps (seconds since the epoch) and will need explicitly call perl_date() or divide the timestamp by 1000 *explicitly*.
=head2 USING OLD Storable::AMF VERSIONS
In older versions (pre 0.79) of Storable::AMF there was no support for the AMF0/AFM3 Date Type, and everything was being passed as string to the server (E.g. "2010-09-22T02:34:00"). Or as double (number) if the date was in timestamp seconds since the...
=head1 MAPPING OBJECTS
By combining the power of Perl bless {}, $package_name syntax and the Storable::AMF freeze()/thaw() interface, it is possible to pass arbitrary structured AMF Objects the corresponding AMF server can interpret. This is possible due a simple Perl obje...
lib/AMF/Connection.pm view on Meta::CPAN
=head2 setHTTPCookieJar ($cookie_jar)
Allow to specify an alternative HTTP::Cookies jar. By default AMF::Connection keeps cookies into main-memory and the cookie jar is reset when a new connection is created. When a new cookies jar is set, any existing AMF::Connection cookie is copied ov...
=head2 getHTTPCookieJar ()
Return the current HTTP::Cookies jar in use.
=head2 setCredentials ($username,$password)
Minimal support for AMF authentication. Password seems to be wanted in clear.
=head2 setInputAMFOptions ($options)
Set input stream parsing options. See Storable::AMF0 for available options.
=head2 setOutputAMFOptions ($options)
Set output stream serialization options. See Storable::AMF0 for available options.
=head2 setAMFOptions ($options)
( run in 3.980 seconds using v1.01-cache-2.11-cpan-5c0b1e786e0 )