DB-CouchDB-Schema

 view release on metacpan or  search on metacpan

lib/DB/CouchDB.pm  view on Meta::CPAN

    my $self    = shift;
    my $method  = shift;
    my $uri     = shift;
    my $content = shift;
    
    my $req     = HTTP::Request->new($method, $uri);
    $req->content(Encode::encode('utf8', $content));
         
    my $ua = LWP::UserAgent->new();
    my $return = $ua->request($req);
    my $response = $return->decoded_content({
		default_charset => 'utf8'
    });
    my $decoded;
    eval {
        $decoded = $self->json()->decode($response);
    };
    if ($@) {
        return {error => $return->code, reason => $response}; 
    }
    return $decoded;
}

package DB::CouchDB::Iter;

sub new {
    my $self = shift;
    my $results = shift;
    my $rows = $results->{rows};
    
    return bless { data => $rows,



( run in 0.225 second using v1.01-cache-2.11-cpan-26ccb49234f )