Group
Extension

Matches 4

Apache2-REST ( J/JE/JETEVE/Apache2-REST-0.07.tar.gz, JETEVE, 2010; MetaCPAN )
Apache2-REST/lib/Apache2/REST/Writer/json.pm ( view source; MetaCPAN )
package Apache2::REST::Writer::json ;
use strict ;

use JSON::XS ;

use Data::Dumper ;

=head1 NAME

Apache2::REST::Writer::json - Apache2::REST::Response Writer for json

=cut

=head2 new

=cut

sub 
ication/json' ;
}

=head2 asBytes

Returns the response as json UTF8 bytes for output.

=cut

sub asBytes{
    my ($self,  $resp ) = @_ ;
    
    #Shallow unblessed copy of response
    # JSON wont o
utput blessed object not implementing the TO_JSON request
    my %resp = %$resp ;
    my $coder = JSON::XS->new->allow_blessed(0)->utf8;
    ## These are bytes. This is correct.
    return $coder->enc
Apache2-REST ( J/JE/JETEVE/Apache2-REST-0.07.tar.gz, JETEVE, 2010; MetaCPAN )
Apache2-REST/lib/Apache2/REST/Writer/perl.pm ( view source; MetaCPAN )
{} , $class;
}

=head2 mimeType

Getter

=cut

sub mimeType{
    # Ideal
    #return 'application/json' ;
    # Reality
    return 'application/x-perl';
}

=head2 asBytes

Returns the response as yaml
Apache2-REST ( J/JE/JETEVE/Apache2-REST-0.07.tar.gz, JETEVE, 2010; MetaCPAN )
Apache2-REST/lib/Apache2/REST/Writer/bin.pm ( view source; MetaCPAN )
package Apache2::REST::Writer::bin ;
use strict ;

use JSON::XS ;

use Data::Dumper ;

=head1 NAME

Apache2::REST::Writer::bin - Apache2::REST::Response Writer for binary

=head1 DESCRIPTION

This wri
->binMimeType() ;
    }
    return 'application/bin' ;
}

=head2 asBytes

Returns the response as json UTF8 bytes for output.

=cut

sub asBytes{
    my ($self,  $resp ) = @_ ;
    
    return $resp->
Apache2-REST ( J/JE/JETEVE/Apache2-REST-0.07.tar.gz, JETEVE, 2010; MetaCPAN )
Apache2-REST/lib/Apache2/REST.pm ( view source; MetaCPAN )
 from the fmt parameter. For instance '?fmt=json'
    extension - With this method, the writer is selected from the url extension. For instance : '/test.json'
    header - With this method, the writer
   
    When using 'param' (default) ask for json format like this: http://localhost/test/?fmt=json
    When using 'extension' : http://localhost/test.json

=head3 Apache2RESTWriterDefault

Sets the d
efault writer. If ommitted, the default is C<xml>. Available writers are C<xml>, C<json>, C<yaml>, C<perl>, C<bin>

=head2 command line REST client

This module comes with a commandline REST client to

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