def urlget(url, *args, **kwargs):
 data = kwargs.pop('data', None)
 exception = kwargs.pop('exception', PluginError)
 method = kwargs.pop('method', 'GET')
 session = kwargs.pop('session', None)
 timeout = kwargs.pop('timeout', 20)
 if (data is not None):
  method = 'POST'
 try:
  if session:
   res = session.request(method, url, timeout=timeout, data=data, *args, **kwargs)
  else:
   res = requests.request(method, url, timeout=timeout, data=data, *args, **kwargs)
  res.raise_for_status()
 except (requests.exceptions.RequestException, IOError) as rerr:
  err = exception('Unable to open URL: {url} ({err})'.format(url=url, err=rerr))
  err.err = rerr
  raise err
 return res

def urlget ( url , * args , ** kwargs ) : data = kwargs . pop ( 'data' , None ) exception = kwargs . pop ( 'exception' , PluginError ) method = kwargs . pop ( 'method' , 'GET' ) session = kwargs . pop ( 'session' , None ) timeout = kwargs . pop ( 'timeout' , 20 ) if ( data is not None ) : method = 'POST' try : if session : res = session . request ( method , url , timeout = timeout , data = data , * args , ** kwargs ) else : res = requests . request ( method , url , timeout = timeout , data = data , * args , ** kwargs ) res . raise_for_status ( ) except ( requests . exceptions . RequestException , IOError ) as rerr : err = exception ( 'Unable to open URL: {url} ({err})' . format ( url = url , err = rerr ) ) err . err = rerr raise err return res
this function is deprecated .