Group
Extension

Matches 8

Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/config/MREST_Config.pm ( view source; MetaCPAN )
ed content types (major portions only!)
set( 'MREST_SUPPORTED_CONTENT_TYPES', [ 
    'application/json',
] );

# MREST_CACHE_ENABLED
#     set to 0 to include response headers telling clients not to c
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST/Util.pm ( view source; MetaCPAN )
;

use App::CELL qw( $log );
use File::Spec;
use JSON;
use Params::Validate qw( :all );
use Pod::Simple::HTML;
use Pod::Simple::Text;


our $JSON = JSON->new->allow_nonref->convert_blessed->utf8->pret
rts:

=over 

=item C<$JSON> (singleton)

=item C<pod_to_html> (function)

=item C<pod_to_text> (function)

=back

=cut

use Exporter qw( import );
our @EXPORT_OK = qw(
    $JSON
    pod_to_html
    p
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST/Resource.pm ( view source; MetaCPAN )
tus;
use Data::Dumper;
use JSON;
use Params::Validate qw( :all );
use Plack::Session;
use Try::Tiny;
use Web::MREST::InitRouter qw( $router );
use Web::MREST::Util qw( $JSON );

# methods/attributes n
$declared_status->payload->{'permanent'} = $pt ? JSON::true : JSON::false;
        } else {
            $declared_status->payload->{'permanent'} = JSON::true;
        }

    } else {

        #
      
e undef
                permanent => ( $ARGS{'permanent'} )
                    ? JSON::true
                    : JSON::false,
            },
        );

    }

    # add standard properties to the p
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST/Dispatch.pm ( view source; MetaCPAN )
ructions for reporting bugs in Web::MREST',
            documentation => <<'EOH',
=pod

Returns a JSON structure containing instructions for reporting bugs.
EOH
        },
    
        # configinfo
  
qeuest for one of
these subresources, including the resource name in the request
entity as a bare JSON string (i.e. in double quotes).
EOH
        },
    
        # docu/pod
        'docu/pod' => 
   
  handler => {
                POST => 'handler_echo', 
            },
            cli => 'echo [$JSON]',
            description => 'Echo the request body',
            documentation => <<'EOH',
=pod
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST/WebServicesIntro.pm ( view source; MetaCPAN )
od:       POST 
    URI:          http://myapp.example.com/
    Header:       Accept: application/json
    Body:         { 
                      "command" : "employee.insert",
                      "
                }

Example HTTP response:

    Status code:  200 OK
    Content-Type: application/json
    Body:         {
                      "status" : {
                          "level" : "ERROR
t step, which Richardson calls "Many URIs, one HTTP method", involves
moving some part of the XML/JSON body into the URI. Though this step might seem
insignificant, calling it "revolutionary" would be
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST/Entity.pm ( view source; MetaCPAN )
site );
use Data::Dumper;
use Try::Tiny;
use Web::Machine::FSM::States;
use Web::MREST::Util qw( $JSON );

use parent 'Web::MREST::Resource';




=head1 NAME

Web::MREST::Entity - Methods for dealing 
ing format:

    [
        { 'text/html' => 'method_for_html' },
        { 'application/json' => 'method_for_json' },
        { 'other/mime' => 'method_for_other_mime' },
    ]

As you can see, this i
 { 'application/json' => 'mrest_generate_response_json' },
    ];
}


=head2 mrest_generate_response_html

Normally, clients will communicate with the server via
'_render_response_json', but humans ne
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST/Test.pm ( view source; MetaCPAN )
ta::Dumper;
use File::HomeDir;
use HTTP::Request;
use JSON;
use Log::Any::Adapter;
use Params::Validate qw( :all );
use Plack::Test;
use Test::JSON;
use Test::More;
use Try::Tiny;
use Web::Machine;
us
ameters were loaded' );
    is_deeply( [ $site->MREST_SUPPORTED_CONTENT_TYPES ], [ [ 'application/json' ] ],
        'configuration parameters loaded?' );

    # set debug mode
    $log->debug_mode( $


=head2 status_from_json

L<Web::MREST> is designed to return status objects in the HTTP response entity.
Before inclusion in the response, the status object is converted to JSON. This
routine goes t
Web-MREST ( S/SM/SMITHFARM/Web-MREST-0.290.tar.gz, SMITHFARM, 2022; MetaCPAN )
Web-MREST/lib/Web/MREST.pm ( view source; MetaCPAN )
obtained using C<curl>:

     curl -v http://localhost:5000/ -X GET -H "Content-Type: application/json"

For more information on using the CLI client, see L<Web::MREST::CLI>.



=head1 DESCRIPTION

MR
value), the handler
is expected to return a C<App::CELL::Status> object. This object (rendered in
JSON) becomes the response entity unless overrided by a declared status (see
C<mrest_declare_status> i
hat is returned, but a JSON
representation of its underlying data structure. From this, the object can
easily be reconstituted on the client side by doing

    my $status = $JSON->decode( $response_en

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