@@ -171,7 +171,9 @@ def _request(self, method, url, params=None, data=None, headers=None,
171
171
but with added caching-related tools
172
172
173
173
This is a low-level method not generally intended for use by astroquery
174
- end-users.
174
+ end-users. However, it should _always_ be used by astroquery
175
+ developers; direct uses of `urllib` or `requests` are almost never
176
+ correct.
175
177
176
178
Parameters
177
179
----------
@@ -194,7 +196,12 @@ def _request(self, method, url, params=None, data=None, headers=None,
194
196
timeout : int
195
197
cache : bool
196
198
verify : bool
199
+ Verify the server's TLS certificate?
200
+ (see http://docs.python-requests.org/en/master/_modules/requests/sessions/?highlight=verify)
197
201
continuation : bool
202
+ If the file is partly downloaded to the target location, this
203
+ parameter will try to continue the download where it left off.
204
+ See `_download_file`.
198
205
stream : bool
199
206
200
207
Returns
@@ -219,10 +226,9 @@ def _request(self, method, url, params=None, data=None, headers=None,
219
226
# ":" so replace them with an underscore
220
227
local_filename = local_filename .replace (':' , '_' )
221
228
local_filepath = os .path .join (self .cache_location or savedir or '.' , local_filename )
222
- # REDUNDANT: spinner has this log.info("Downloading
223
- # {0}...".format(local_filename))
224
- self ._download_file (url , local_filepath , cache = cache , continuation = continuation , method = method , auth = auth ,
225
- ** req_kwargs )
229
+ self ._download_file (url , local_filepath , cache = cache ,
230
+ continuation = continuation , method = method ,
231
+ auth = auth , ** req_kwargs )
226
232
return local_filepath
227
233
else :
228
234
query = AstroQuery (method , url , ** req_kwargs )
@@ -243,10 +249,25 @@ def _request(self, method, url, params=None, data=None, headers=None,
243
249
return response
244
250
245
251
def _download_file (self , url , local_filepath , timeout = None , auth = None ,
246
- continuation = True , cache = False , method = "GET" , head_safe = False , ** kwargs ):
252
+ continuation = True , cache = False , method = "GET" ,
253
+ head_safe = False , ** kwargs ):
247
254
"""
248
255
Download a file. Resembles `astropy.utils.data.download_file` but uses
249
256
the local ``_session``
257
+
258
+ Parameters
259
+ ----------
260
+ url : string
261
+ local_filepath : string
262
+ timeout : int
263
+ auth : dict or None
264
+ continuation : bool
265
+ If the file has already been partially downloaded *and* the server
266
+ supports HTTP "range" requests, the download will be continued
267
+ where it left off.
268
+ cache : bool
269
+ method : "GET" or "POST"
270
+ head_safe : bool
250
271
"""
251
272
252
273
if head_safe :
0 commit comments