Skip to content

Commit

Permalink
use standard _request with new json keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
pothiers committed Apr 16, 2020
1 parent b83f690 commit cb80bc8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions astroquery/noirlab/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}')
Expand All @@ -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()
Expand Down

0 comments on commit cb80bc8

Please sign in to comment.