Group
Extension

Matches 5

Froody ( F/FO/FOTANGO/Froody-42.041_2.tar.gz, FOTANGO, 2007; MetaCPAN )
Froody/lib/Froody/Renderer/json.pm ( view source; MetaCPAN )
package Froody::Renderer::json;
use strict;
use warnings;

use JSON::XS qw( to_json );

use Froody::Response;
use Froody::Response::Terse;
use Encode;

# If we don't know how to do it ourselves, conve
der_json = sub {
  my $self = shift;
  return $self->as_terse->render_json;
};

# Terse format just gets the main data structure out
# and renders it with JSON
*Froody::Response::Terse::render_json = 
sub {
  my $self = shift;
  my $callback = $self->callback;
  my $bytes = to_json( { stat => $self->status, data => $self->content } );
  return $callback ? "$callback( $bytes )" : $bytes;
};

1;
Froody ( F/FO/FOTANGO/Froody-42.041_2.tar.gz, FOTANGO, 2007; MetaCPAN )
Froody/lib/Froody/Request/CGI.pm ( view source; MetaCPAN )
, 1 );
      $vars{ $pname } = $value;
    }
  }

  if ($type and $type eq 'json') {
    $self->callback( delete $vars{"_json_callback"} );
  }

  $self->params(\%vars);
  
  return $self;
}

=back

=
Froody ( F/FO/FOTANGO/Froody-42.041_2.tar.gz, FOTANGO, 2007; MetaCPAN )
Froody/lib/Froody/SimpleClient.pm ( view source; MetaCPAN )
or::Chained::Fast );
__PACKAGE__->mk_accessors(qw( endpoint ));

use LWP::UserAgent;
use JSON::XS qw( from_json );
use HTTP::Request::Common;
use Encode qw( encode_utf8 );

=head1 ATTRIBUTES

=over

=
{ $_[0] } : @_;

  # we want json
  $args{_type} = "json";

  my $response = $self->call_raw($method, %args);
  # parse as Frooy/JSON response
  my $data = eval { from_json( $response ) };
  unless (r
Froody ( F/FO/FOTANGO/Froody-42.041_2.tar.gz, FOTANGO, 2007; MetaCPAN )
Froody/lib/Froody/Request/Apache.pm ( view source; MetaCPAN )
e $vars->{'_froody_type'};
  $self->type($type);
  if ($type and $type eq 'json') {
    $self->callback( delete $vars->{"_json_callback"} );
  }
  $self->params($vars);
  
  return $self;
}

=item get
Froody ( F/FO/FOTANGO/Froody-42.041_2.tar.gz, FOTANGO, 2007; MetaCPAN )
Froody/lib/Froody/Server.pm ( view source; MetaCPAN )
::Response;

use Froody::Logger;
my $logger = get_logger("froody.server");

use Froody::Renderer::json;

# XXX: move down to autoload when doing autodetect
eval q{
    use Apache::Constants;
    use F
ts the header for a type of server.

=cut

my $h4t = {
	xml => "text/xml; charset=utf-8",
	json => 'text/json',
};

sub content_type_for_type {
   my $class = shift;
   my $type  = shift;
   unless (@

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.