WWW::LogicBoxes::Role::Command - Basic Logic for Submission of Requests to LogicBoxes
use WWW::LogicBoxes; use WWW::LogicBoxes::Contact; my $logic_boxes = WWW::LogicBoxes->new( ... ); my $contact = WWW::LogicBoxes::Contact->new( ... ); my $response = $logic_boxes->submit({ method => 'contacts__add', params => $contact->construct_creation_request(), });
response_type
Primary interface to LogicBoxes API that is used by the rest of the WWW::LogicBoxes::Role::Command::* roles. The only reason a consumer would use the submit method directly would be if there was no corresponding Command for the needed operation.
use WWW::LogicBoxes; use WWW::LogicBoxes::Contact; my $logic_boxes = WWW::LogicBoxes->new( ... ); my $contact = WWW::LogicBoxes::Contact->new( ... ); my $response = $logic_boxes->submit({ method => 'contacts__add', params => $contact->construct_creation_request(), # Optional for some methods });
The submit method is what sends requests over to LogicBoxes. It accepts a raw method and an optional HashRef of params (almost all methods require params to be provided, but not all do). For details on the structure of the params please see WWW::LogicBoxes::Role::Command::Raw.
The submit method returns a HashRef that represents the data returned by LogicBoxes. There is logic built into submit such that requests are always made with a JSON response which is what drives the creation of the HashRef form the response.
To install WWW::LogicBoxes, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::LogicBoxes
CPAN shell
perl -MCPAN -e shell install WWW::LogicBoxes
For more information on module installation, please visit the detailed CPAN module installation guide.