File: HTTPClient.pm

package info (click to toggle)
librt-client-rest-perl 1%3A0.50-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 536 kB
  • ctags: 266
  • sloc: perl: 4,768; makefile: 4
file content (33 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Subclass LWP::UserAgent in order to support basic authentication.

package RT::Client::REST::HTTPClient;

use strict;
use warnings;

use vars qw($VERSION);
$VERSION = '0.01';

use base 'LWP::UserAgent';

sub get_basic_credentials {
    my $self = shift;

    if ($self->basic_auth_cb) {
        return $self->basic_auth_cb->(@_);
    } else {
        return;
    }
}

sub basic_auth_cb {
    my $self = shift;

    if (@_) {
        $self->{basic_auth_cb} = shift;
    }

    return $self->{basic_auth_cb};
}

1;