File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,6 @@ def __init__(
5555 base_url = base_url [:- 1 ]
5656 self .base_url = base_url
5757
58- # Persistent session
59- self .session = requests .Session ()
60-
61- # Mount the adapter once during initialization
62- self .session .mount ("https://" , HTTPAdapter (max_retries = self .retries ))
63- self .session .mount ("http://" , HTTPAdapter (max_retries = self .retries ))
64-
6558 # Custom headers
6659 self .headers = headers .copy () if headers else {}
6760
@@ -101,6 +94,13 @@ def __init__(
10194 raise_on_status = False ,
10295 )
10396
97+ # Persistent session
98+ self .session = requests .Session ()
99+
100+ # Mount the adapter once during initialization
101+ self .session .mount ("https://" , HTTPAdapter (max_retries = self .retries ))
102+ self .session .mount ("http://" , HTTPAdapter (max_retries = self .retries ))
103+
104104 # This is for internal dynatrace usage
105105 self .mc_jsession_id = mc_jsession_id
106106 self .mc_b925d32c = mc_b925d32c
Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ def __init__(
7979 timeout : Optional [int ] = None ,
8080 headers : Optional [Dict ] = None ,
8181 ):
82+ if not base_url :
83+ raise ValueError ("base_url is required" )
84+ if not token :
85+ raise ValueError ("token is required" )
86+
8287 self .__http_client = HttpClient (
8388 base_url ,
8489 token ,
You can’t perform that action at this time.
0 commit comments