ServiceBase

class ServiceBase(object):

def __init__(self, host, vpath, headers: dict = None):
self.host = host
self.vpath = vpath
self.headers = headers

def before_request(self):
pass

def after_request(self):
pass

def _get(self, url=None, param=None, **kwargs):
return requests.get(url=url, params=param, **kwargs)

def _post(self, url=None, json=None, data=None, **kwargs):
return requests.post(url=url, json=json, data=data, **kwargs)
posted @ 2024-04-30 18:10  遇事不决,量子力学  阅读(8)  评论(0编辑  收藏  举报