1010from ..utils import async_to_sync
1111from ..utils .class_or_instance import class_or_instance
1212from . import conf
13- import requests
13+ #! import requests
1414
1515
1616__all__ = ['Noirlab' , 'NoirlabClass' ] # specifies what to import
@@ -173,11 +173,11 @@ def query_metadata(self, qspec, limit=1000, cache=True):
173173 # headers = {'Content-Type': 'application/json'}
174174
175175 # Following fails:
176- # #! response = self._request('POST', url, json=jdata)
176+ response = self ._request ('POST' , url , json = jdata , timeout = self . TIMEOUT , )
177177
178- response = requests .post (url ,
179- timeout = self .TIMEOUT ,
180- json = jdata )
178+ #! response = requests.post(url,
179+ #! timeout=self.TIMEOUT,
180+ #! json=jdata)
181181 response .raise_for_status ()
182182 # #!print(f'DBG-0: ADS response={response}')
183183 # #!print(f'DBG-0: ADS response.content={response.content}')
@@ -198,7 +198,7 @@ def version(self, cache=False):
198198
199199 def get_token (self , email , password , cache = True ):
200200 url = f'{ self .NAT_URL } /api/get_token/'
201- response = requests . post ( url ,
201+ response = self . _request ( 'POST' , url ,
202202 json = {"email" : email , "password" : password },
203203 timeout = self .TIMEOUT )
204204 response .raise_for_status ()
0 commit comments