;
use JSON;
use Service::Engine;
our $Config;
our $Log;
our $Data;
our $Log_to_file = '';
our $Log_to_console = 1;
our $Log_to_data = {};
our $EngineName;
our $EngineInstance;
our $JSON = JSON->new
key};
if (ref($value) eq 'HASH' || ref($value) eq 'ARRAY') {
$data->{$key} = $JSON->encode($value);
} elsif (ref($value) eq 'SCALAR') {
$data->{$key} = $$value;
with all the details. Besides, you can
also opt to have Twilio send its responses to you in CSV, JSON, or
HTML.
=head2 Using WWW::Twilio::API
Now that we have a basic understanding of how Twilio's
', 'json', or 'html' (any representation found at
http://www.twilio.com/docs/api/rest/tips) to the Twilio API call:
## return JSON in $response->{content}
$response = $twilio->POST('Calls.json',
## view a list of calls we've made
$response = $twilio->GET('Calls.json');
print $response->{content}; ## this is a JSON document
## view one particular call we've made
$response = $twili
Service::Engine::Health::Throughput;
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use JSON;
use Service::Engine;
our $Config;
our $Log;
our $Threads;
our $EngineName;
our $EngineInstance
use base qw(Net::Server::HTTP);
use Data::Dumper;
use JSON;
use CGI;
sub process_http_request {
my $self = shift;
my $json = JSON->new->allow_nonref;
my $content = '';
my
rd'};
if ($api_password && ($form->{'password'} ne $api_password)) {
$content = eval{$json->encode( {'error'=>"access denied"} )};
} else {
my $allowed_resources = $self->{'Con
lit /\//, $path;
warn("trying $module: $method : $params");
$content = eval{$json->encode( {'error'=>"unknown resource $path"} )};
if ($module && $method && $allowed_
age Service::Engine::Health::Threads;
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use JSON;
use Service::Engine;
our $Config;
our $Log;
our $Threads;
our $EngineName;
our $EngineInstance
kage Service::Engine::Health::Memory;
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use JSON;
use Service::Engine;
our $Config;
our $Log;
our $Threads;
our $EngineName;
our $EngineInstance
age Service::Engine::Health::Backlog;
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use JSON;
use Service::Engine;
our $Config;
our $Log;
our $Threads;
our $EngineName;
our $EngineInstance
e Module::Runtime qw(require_module);
use Service::Engine;
use threads;
use threads::shared;
use JSON;
our $Config;
our $Log;
our $Data;
our $EngineName;
our $EngineInstance;
our $Threads;
our $Chec
f, $fh) = @_;
my $data = $self->overview(undef,1);
my $json = JSON->new->allow_nonref;
my $json_string = eval{$json->encode( $data )};
$Log->log({'msg'=>"$@",'level'=>2}) if $@;
if ($fh) {
$Log->log({msg=>"i think I have a fh in api_overview",level=>3});
$fh->write($json_string);
} else {
return $json_string;
}
}
1;