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__(
55
55
base_url = base_url [:- 1 ]
56
56
self .base_url = base_url
57
57
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
-
65
58
# Custom headers
66
59
self .headers = headers .copy () if headers else {}
67
60
@@ -101,6 +94,13 @@ def __init__(
101
94
raise_on_status = False ,
102
95
)
103
96
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
+
104
104
# This is for internal dynatrace usage
105
105
self .mc_jsession_id = mc_jsession_id
106
106
self .mc_b925d32c = mc_b925d32c
Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ def __init__(
79
79
timeout : Optional [int ] = None ,
80
80
headers : Optional [Dict ] = None ,
81
81
):
82
+ if not base_url :
83
+ raise ValueError ("base_url is required" )
84
+ if not token :
85
+ raise ValueError ("token is required" )
86
+
82
87
self .__http_client = HttpClient (
83
88
base_url ,
84
89
token ,
You can’t perform that action at this time.
0 commit comments