GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::HTTP::SPORE::MIDDLEWARE::FORMAT (3)

.ds Aq ’

NAME

Net::HTTP::Spore::Middleware::Format - base class for formats middlewares

CONTENTS

VERSION

version 0.06

SYNOPSIS



    my $client = Net::HTTP::Spore->new_from_spec(twitter.json);
    $client->enable(Format::JSON);

    my $res = $client->public_timeline();
    # $res->body contains an hashref build from the JSON returned by the API



DESCRPITION

This middleware is a base class for others format’s middleware. Thoses middlewares must set the appropriate <B>Content-TypeB> and <B>AcceptB> header to the request.

If the environment contains a <B>payloadB> (under the name ’spore.payload’), it should also serialize this data to the appropriate format (eg: if payload contains an hashref, and the format is json, the hashref <B>MUSTB> be serialized to JSON).

METHODS

serializer_key name of the extension serializer should check to be sure to not encode a payload already encoded, or set the headers that have already been defined
deserializer_key as previously, but for the response instead of the request
encode this method <B>MUSTB> be implemented in class extending this one. This method <B>MUSTB> return an encoded string from the argument passed.
decode this method <B>MUSTB> be implemented in class extending this one. This method <B>MUSTB> return a reference from the undecoded string passed as argument.
accept_type this method <B>MUSTB> be implemented in class extending this one. This method <B>MUSTB> return a string that will be used as the <B>AcceptB> HTTP header.
content_type this method <B>MUSTB> be implemented in class extending this one. This method <B>MUSTB> return a string that will be used as the <B>Content-TypeB> HTTP header.
should_serialize this method returns 1 if serialization have not already been done
should_deserialize this method returns 1 if deserialization have not already been done
call

AUTHORS

o franck cuny <franck@lumberjaph.net>
o Ash Berlin <ash@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by linkfluence.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::HTTP::SPORE::MIDDLEWARE::FORMAT (3) 2013-04-19

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.