File Coverage

blib/lib/Net/HTTP/Spore/Middleware/Format/Text.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 4 4 100.0
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Net::HTTP::Spore::Middleware::Format::Text;
2             $Net::HTTP::Spore::Middleware::Format::Text::VERSION = '0.09';
3             # ABSTRACT: middleware for Text format
4 1     1   646 use Moose;
  1         3  
  1         8  
5             extends 'Net::HTTP::Spore::Middleware::Format';
6              
7 1     1 1 23 sub encode { $_[1] }
8 2     2 1 8 sub decode { $_[1] }
9 2     2 1 18 sub accept_type { ( 'Accept' => 'text/plain' ) }
10 1     1 1 5 sub content_type { ( 'Content-Type' => 'text/plain' ) }
11              
12             1;
13              
14             __END__
15              
16             =pod
17              
18             =encoding UTF-8
19              
20             =head1 NAME
21              
22             Net::HTTP::Spore::Middleware::Format::Text - middleware for Text format
23              
24             =head1 VERSION
25              
26             version 0.09
27              
28             =head1 SYNOPSIS
29              
30             my $client = Net::HTTP::Spore->new_from_spec('twitter.json');
31             $client->enable('Format::Text');
32              
33             =head1 DESCRIPTION
34              
35             Net::HTTP::Spore::Middleware::Format::Text is a simple middleware to
36             handle requests in C<text/plain> format. It will set the appropriate
37             B<Accept> header in your request. If the request method is PUT or
38             POST, the B<Content-Type> header will also be set to C<text/plain>.
39              
40             =head1 AUTHORS
41              
42             =over 4
43              
44             =item *
45              
46             Franck Cuny <franck.cuny@gmail.com>
47              
48             =item *
49              
50             Ash Berlin <ash@cpan.org>
51              
52             =item *
53              
54             Ahmad Fatoum <athreef@cpan.org>
55              
56             =back
57              
58             =head1 COPYRIGHT AND LICENSE
59              
60             This software is copyright (c) 2012 by Linkfluence.
61              
62             This is free software; you can redistribute it and/or modify it under
63             the same terms as the Perl 5 programming language system itself.
64              
65             =cut