bugfix
This commit is contained in:
parent
a10afe270f
commit
e702b93762
@ -39,9 +39,12 @@ class DictObject:
|
|||||||
def __setitem__(self,name,value):
|
def __setitem__(self,name,value):
|
||||||
self.kwargs[name] = value
|
self.kwargs[name] = value
|
||||||
|
|
||||||
def __delattr__(self,name):
|
def __delitem__(self,name):
|
||||||
self.kwargs.pop(name)
|
self.kwargs.pop(name)
|
||||||
|
|
||||||
|
def get(self,name,dv=None):
|
||||||
|
return self.kwargs.get(name,dv)
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
return self.kwargs.copy()
|
return self.kwargs.copy()
|
||||||
|
|
||||||
|
@ -20,9 +20,10 @@ class HTTPError(Exception):
|
|||||||
|
|
||||||
hostsessions = {}
|
hostsessions = {}
|
||||||
|
|
||||||
class HttpClient:
|
class Http_Client:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.s = requests.Session()
|
self.s = requests.Session()
|
||||||
|
self.s.verify = False
|
||||||
|
|
||||||
def url2domain(self,url):
|
def url2domain(self,url):
|
||||||
parts = url.split('/')[:3]
|
parts = url.split('/')[:3]
|
||||||
@ -64,7 +65,7 @@ class HttpClient:
|
|||||||
print('Error', url, method,
|
print('Error', url, method,
|
||||||
params, resp.status_code,
|
params, resp.status_code,
|
||||||
type(resp.status_code))
|
type(resp.status_code))
|
||||||
raise HTTPError(resp.status_code)
|
raise HTTPError(resp.status_code,url)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def webcall(self,url,method="GET",
|
def webcall(self,url,method="GET",
|
||||||
|
Loading…
Reference in New Issue
Block a user