Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use LWP::UserAgent;
- use HTTP::Request::Common qw(POST GET DELETE);
- sub WriteInflux {
- my $server = shift;
- my $db = shift;
- my @dat = @_;
- my $body = join "\n", @dat;
- my $url = "http://$server:8086/write?db=$db&precision=s";
- my $ua = LWP::UserAgent->new;
- my $req = (POST $url, Content=>$body);
- my $res = $ua->request($req);
- print "code: ", $res->code, "\n";
- print "content: ", $res->content, "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement