|
@@ -34,8 +34,8 @@ class HTTPService:
|
|
|
self.debug = config['http'].get('debug', False)
|
|
self.debug = config['http'].get('debug', False)
|
|
|
self.base_url = config['http'].get('server_url')
|
|
self.base_url = config['http'].get('server_url')
|
|
|
self.endpoint = config['http'].get('endpoint')
|
|
self.endpoint = config['http'].get('endpoint')
|
|
|
- self.username = config['http'].get('username')
|
|
|
|
|
- self.password = config['http'].get('password')
|
|
|
|
|
|
|
+ self.username = config['http'].get('username', "")
|
|
|
|
|
+ self.password = config['http'].get('password', "")
|
|
|
|
|
|
|
|
def fetch_cell_info(self, cell_id):
|
|
def fetch_cell_info(self, cell_id):
|
|
|
if self.debug:
|
|
if self.debug:
|
|
@@ -43,16 +43,17 @@ class HTTPService:
|
|
|
|
|
|
|
|
url = f"{self.base_url}/{self.endpoint}/{cell_id}/"
|
|
url = f"{self.base_url}/{self.endpoint}/{cell_id}/"
|
|
|
|
|
|
|
|
- # Basic Authentication (if required)
|
|
|
|
|
- auth = (self.username, self.password)
|
|
|
|
|
-
|
|
|
|
|
# Headers
|
|
# Headers
|
|
|
headers = {
|
|
headers = {
|
|
|
"Accept": "application/json"
|
|
"Accept": "application/json"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- # Making the GET request
|
|
|
|
|
- response = requests.get(url, auth=auth, headers=headers)
|
|
|
|
|
|
|
+ # Basic Authentication (if required)
|
|
|
|
|
+ if self.username and self.password:
|
|
|
|
|
+ auth = (self.username, self.password)
|
|
|
|
|
+ response = requests.get(url, auth=auth, headers=headers, verify=False)
|
|
|
|
|
+ else:
|
|
|
|
|
+ response = requests.get(url, headers=headers, verify=False)
|
|
|
|
|
|
|
|
# Check if the request was successful
|
|
# Check if the request was successful
|
|
|
if response.status_code == 200:
|
|
if response.status_code == 200:
|