WWW-Suffit-UserAgent

 view release on metacpan or  search on metacpan

lib/WWW/Suffit/UserAgent.pm  view on Meta::CPAN

        # http://localhost:8695/api/foo/bar

Merges path to tail of url

    # For url = http://localhost:8695/api
    my $url_str = $client->path2url("/foo/bar", 1);
        # http://localhost:8695/foo/bar

Sets path to url

=head2 private_key

    $clinet = $clinet->private_key("---- BEGIN ... END -----");
    my $private_key = $client->private_key;

Sets or returns RSA private key

=head2 public_key

    $clinet = $clinet->public_key("---- BEGIN ... END -----");
    my $public_key = $client->public_key;

Sets or returns RSA public key

lib/WWW/Suffit/UserAgent.pm  view on Meta::CPAN

    $args{username} //= $args{url}->username // '';
    $args{password} //= $args{url}->password // '';
    $args{ask_credentials} ||= 0;

    # API/Access/Session token
    $args{token} //= "";
    $args{token_name} ||= TOKEN_HEADER_NAME;

    # Security
    $args{public_key} //= "";
    $args{private_key} //= "";

    # Proxy string
    $args{proxy} //= "";

    # Transaction (tx)
    $args{trace} = []; # trace pool
    $args{tx_string} = "";
    $args{tx_time} = 0;
    $args{req} = undef;
    $args{res} = undef;

lib/WWW/Suffit/UserAgent.pm  view on Meta::CPAN

}
sub public_key {
    my $self = shift;
    my $k = shift;
    if (defined $k) {
        $self->{public_key} = $k;
        return $self;
    }
    return $self->{public_key};
}
sub private_key {
    my $self = shift;
    my $k = shift;
    if (defined $k) {
        $self->{private_key} = $k;
        return $self;
    }
    return $self->{private_key};
}
sub proxy {
    my $self = shift;
    my $p = shift;
    return $self->{proxy} unless defined $p;
    $self->{proxy} = $p;

    # Set proxy
    $self->ua->proxy->http($p)->https($p) if length $p;



( run in 0.224 second using v1.01-cache-2.11-cpan-a5abf4f5562 )