Group
Extension

Matches 2

CatalystX-ExtJS-REST ( P/PE/PERLER/CatalystX-ExtJS-REST-2.1.3.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-REST/benchmark/rest.pl ( view source; MetaCPAN )
t::Common;
use JSON;

use lib qw(t/lib);

use Test::WWW::Mechanize::Catalyst 'MyApp';

my $mech = Test::WWW::Mechanize::Catalyst->new();

$mech->add_header('Accept' => 'application/json');

$mech->get
$json = JSON::decode_json($mech->content), 'response is JSON response');

is($json->{results}, 0, 'no results');

my $res = $mech->request(POST '/user', [name => 'bar', password => 'foo']);

ok($json 
= JSON::decode_json($res->content), 'response is JSON response');

is($json->{success}, 'true', 'submission was successful');

is($res->header('location'), 'http://localhost/user/1', 'user location is
CatalystX-ExtJS-REST ( P/PE/PERLER/CatalystX-ExtJS-REST-2.1.3.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-REST/lib/CatalystX/Controller/ExtJS/REST.pm ( view source; MetaCPAN )

use HTML::FormFu::ExtJS 0.076;
use Path::Class;
use HTML::Entities;
use Lingua::EN::Inflect;
use JSON;
use Try::Tiny;

use Moose::Util::TypeConstraints;
subtype 'PathClassDir', as 'Path::Class::Dir';
'stash_key'}
          )
          || 'rest';
        my $output;
        eval { $output = encode_json( $c->stash->{$stash_key} ); };

        $c->res->content_type('text/html');
        $c->res->outp
({ ... });
  1;
  
  # set the Accept header to 'application/json' globally
  
  Ext.Ajax.defaultHeaders = {
   'Accept': 'application/json'
  };

=head1 DESCRIPTION

This controller will make CRUD op

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