Skip to content

Commit cb80bc8

Browse files
committed
use standard _request with new json keyword
1 parent b83f690 commit cb80bc8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

astroquery/noirlab/core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ..utils import async_to_sync
1111
from ..utils.class_or_instance import class_or_instance
1212
from . 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

Comments
 (0)