obspy.clients.fdsn.routing.routing_client.BaseRoutingClient._download

BaseRoutingClient._download(url, params=None, filename=None, data=None)

Download the URL with GET or POST and the chosen parameters.

Will call the _handle_requests_http_error() method if the response comes back with an HTTP code other than 200. Returns the response object if successful and filename is not given - if given it will save the response to the specified file and return None.

By default it will send a GET request - if data is given it will send a POST request.

Parameters:
  • url (str) The URL to download from.
  • params (dict) Additional URL parameters.
  • filename (str or file-like object) String or file like object. Will download directly to the file. If specified, this function will return nothing.
  • data (dictionary, bytes, or file-like object) If specified, a POST request will be sent with the data in the body of the request.
Returns:

The response object assuming filename is None.

Return type:

requests.Response