diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-07-16 16:10:41 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-07-16 16:10:41 +0200 |
| commit | e97449eaa8bd3a408763057f9ca2253d93e2a3d0 (patch) | |
| tree | 4fd0dc6ed899efe361e314adfc913b9aa6b0a1a4 /lib/Net/HTTP/API/Role | |
| parent | check if auth_method is declared (diff) | |
| download | net-http-api-e97449eaa8bd3a408763057f9ca2253d93e2a3d0.tar.gz | |
rename from mx::net::api to net::http::api
Diffstat (limited to '')
| -rw-r--r-- | lib/Net/HTTP/API/Role/Authentication.pm (renamed from lib/MooseX/Net/API/Role/Authentication.pm) | 2 | ||||
| -rw-r--r-- | lib/Net/HTTP/API/Role/Format.pm (renamed from lib/MooseX/Net/API/Role/Format.pm) | 2 | ||||
| -rw-r--r-- | lib/Net/HTTP/API/Role/Request.pm (renamed from lib/MooseX/Net/API/Role/Request.pm) | 8 | ||||
| -rw-r--r-- | lib/Net/HTTP/API/Role/Serialization.pm (renamed from lib/MooseX/Net/API/Role/Serialization.pm) | 10 | ||||
| -rw-r--r-- | lib/Net/HTTP/API/Role/UserAgent.pm (renamed from lib/MooseX/Net/API/Role/UserAgent.pm) | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/lib/MooseX/Net/API/Role/Authentication.pm b/lib/Net/HTTP/API/Role/Authentication.pm index 06b7e69..27728c3 100644 --- a/lib/MooseX/Net/API/Role/Authentication.pm +++ b/lib/Net/HTTP/API/Role/Authentication.pm @@ -1,4 +1,4 @@ -package MooseX::Net::API::Role::Authentication; +package Net::HTTP::API::Role::Authentication; # ABSTRACT: Add authentication informations to request header diff --git a/lib/MooseX/Net/API/Role/Format.pm b/lib/Net/HTTP/API/Role/Format.pm index 5c37a47..1d8c10f 100644 --- a/lib/MooseX/Net/API/Role/Format.pm +++ b/lib/Net/HTTP/API/Role/Format.pm @@ -1,4 +1,4 @@ -package MooseX::Net::API::Role::Format; +package Net::HTTP::API::Role::Format; # ABSTRACT: Set appropriate format to request header diff --git a/lib/MooseX/Net/API/Role/Request.pm b/lib/Net/HTTP/API/Role/Request.pm index 13221d3..c972b77 100644 --- a/lib/MooseX/Net/API/Role/Request.pm +++ b/lib/Net/HTTP/API/Role/Request.pm @@ -1,10 +1,10 @@ -package MooseX::Net::API::Role::Request; +package Net::HTTP::API::Role::Request; # ABSTRACT: make HTTP request use Moose::Role; use HTTP::Request; -use MooseX::Net::API::Error; +use Net::HTTP::API::Error; use MooseX::Types::URI qw(Uri); has api_base_url => ( @@ -16,7 +16,7 @@ has api_base_url => ( my $self = shift; my $api_base_url = $self->meta->get_api_option('api_base_url'); if (!$api_base_url) { - die MooseX::Net::API::Error->new( + die Net::HTTP::API::Error->new( reason => "'api_base_url' have not been defined"); } $api_base_url; @@ -44,7 +44,7 @@ sub http_request { $request->content($content); } else { - die MooseX::Net::API::Error->new(reason => "$method is not defined"); + die Net::HTTP::API::Error->new(reason => "$method is not defined"); } $request->header( diff --git a/lib/MooseX/Net/API/Role/Serialization.pm b/lib/Net/HTTP/API/Role/Serialization.pm index 92c0248..37d2603 100644 --- a/lib/MooseX/Net/API/Role/Serialization.pm +++ b/lib/Net/HTTP/API/Role/Serialization.pm @@ -1,4 +1,4 @@ -package MooseX::Net::API::Role::Serialization; +package Net::HTTP::API::Role::Serialization; # ABSTRACT: do (de)serialization @@ -6,12 +6,12 @@ use 5.010; use Try::Tiny; use Moose::Role; -use MooseX::Net::API::Error; +use Net::HTTP::API::Error; has serializers => ( traits => ['Hash'], is => 'rw', - isa => 'HashRef[MooseX::Net::API::Parser]', + isa => 'HashRef[Net::HTTP::API::Parser]', default => sub { {} }, auto_deref => 1, handles => { @@ -34,7 +34,7 @@ sub get_content { $content = $self->deserialize($result->content, \@deserialize_order); if (!$content) { - die MooseX::Net::API::Error->new( + die Net::HTTP::API::Error->new( reason => "can't deserialize content", http_error => $result, ); @@ -67,7 +67,7 @@ sub serialize { sub _load_serializer { my $self = shift; my $format = shift || $self->api_format; - my $parser = "MooseX::Net::API::Parser::" . uc($format); + my $parser = "Net::HTTP::API::Parser::" . uc($format); if (Class::MOP::load_class($parser)) { my $o = $parser->new; $self->_add_serializer($format => $o); diff --git a/lib/MooseX/Net/API/Role/UserAgent.pm b/lib/Net/HTTP/API/Role/UserAgent.pm index 3cb9714..84f618d 100644 --- a/lib/MooseX/Net/API/Role/UserAgent.pm +++ b/lib/Net/HTTP/API/Role/UserAgent.pm @@ -1,4 +1,4 @@ -package MooseX::Net::API::Role::UserAgent; +package Net::HTTP::API::Role::UserAgent; # ABSTRACT: create UserAgent @@ -15,7 +15,7 @@ has api_useragent => ( return $ua->() if $ua; $ua = LWP::UserAgent->new(); $ua->agent( - "MooseX::Net::API " . $MooseX::Net::API::VERSION . " (Perl)"); + "Net::HTTP::API " . $Net::HTTP::API::VERSION . " (Perl)"); $ua->env_proxy; return $ua; } |
