Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def send(self, request, stream=False, timeout=None, verify=False, cert=None, proxies=None):
if request.method != 'GET':
raise HTTPMethodUnavailableError("FTP requests do not support method '%s'" %
request.method, request.method)
try:
real_resp = urllib_urlopen(request.url, timeout=timeout)
# we're going to fake a requests.Response with this
resp = requests.Response()
resp.status_code = 200
resp.url = request.url
resp.headers = {}
resp._content = real_resp.read()
resp.raw = _dummy
return resp
except URLError:
raise FTPError(request.url)
def __init__(self, url):
message = 'error while retrieving %s' % url
super(FTPError, self).__init__(message)