From 1a11d8fbc1f8f3563d4cf3e81b2a832d4b77257d Mon Sep 17 00:00:00 2001 From: Steve Pothier Date: Thu, 16 Apr 2020 10:56:21 -0700 Subject: [PATCH] use standard _request with new json keyword --- astroquery/noirlab/core.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/astroquery/noirlab/core.py b/astroquery/noirlab/core.py index 67322b1d3f..40015b365e 100644 --- a/astroquery/noirlab/core.py +++ b/astroquery/noirlab/core.py @@ -10,7 +10,7 @@ from ..utils import async_to_sync from ..utils.class_or_instance import class_or_instance from . import conf -import requests +#!import requests __all__ = ['Noirlab', 'NoirlabClass'] # specifies what to import @@ -173,11 +173,11 @@ def query_metadata(self, qspec, limit=1000, cache=True): # headers = {'Content-Type': 'application/json'} # Following fails: - # #!response = self._request('POST', url, json=jdata) + response = self._request('POST', url, json=jdata, timeout=self.TIMEOUT,) - response = requests.post(url, - timeout=self.TIMEOUT, - json=jdata) + #! response = requests.post(url, + #! timeout=self.TIMEOUT, + #! json=jdata) response.raise_for_status() # #!print(f'DBG-0: ADS response={response}') # #!print(f'DBG-0: ADS response.content={response.content}') @@ -198,7 +198,7 @@ def version(self, cache=False): def get_token(self, email, password, cache=True): url = f'{self.NAT_URL}/api/get_token/' - response = requests.post(url, + response = self._request('POST', url, json={"email": email, "password": password}, timeout=self.TIMEOUT) response.raise_for_status()