Browse Source

move to correct path

nas 2 years ago
parent
commit
19e1e894ae
2 changed files with 0 additions and 41 deletions
  1. 0
    6
      test/test.cfg.sample
  2. 0
    35
      test/test.pl

+ 0
- 6
test/test.cfg.sample View File

@@ -1,6 +0,0 @@
1
-[Authentification]
2
-Protocol : https
3
-Host : localhost
4
-Path : api/v1/ 
5
-Username : test_remote
6
-Password : NJfccjabWSXqmpTRhfXRs6Re2CAIsJyhz3TAo4rpWz2nlMgWqTScmbsXoIlwdHB1

+ 0
- 35
test/test.pl View File

@@ -1,35 +0,0 @@
1
-#!/usr/bin/perl
2
-# @file journal.pl
3
-# @author nas
4
-# @date 31/01/2022
5
-# @brief Remote call to the API in order to test
6
-
7
-use Config::Std;
8
-use LWP::UserAgent ();
9
-
10
-read_config 'test.cfg' => my %config; 
11
-print "Username : $config{Authentification}{Username}\n";
12
-print "Host : $config{Authentification}{Host}\n";
13
-print "Host : $config{Authentification}{Path}\n";
14
-print "Protocol : $config{Authentification}{Username}\n";
15
-
16
-local $url = "$config{Authentification}{Host}$config{Authentification}{Path}";
17
-local $ua = LWP::UserAgent->new(timeout => 10);
18
-$ua->env_proxy;
19
-
20
-sub rq {
21
-  my $path = (exists $_[0])? $_[0] : "";
22
-  my $response = $ua->get( "$url$path" );
23
-  print "rq $url$path\n";
24
-  if ($response->is_success) {
25
-    print $response->decoded_content;
26
-    print "\n";
27
-  }
28
-  else {
29
-    print $response->status_line;
30
-    print "\n";
31
-  }
32
-}
33
-
34
-rq();
35
-rq( "tokens" );

Loading…
Cancel
Save