def __api_request(self,url,method,**karg):
try:return requests.__dict__[method.lower().strip()](url,**karg)
except requests.exceptions.MissingSchema as e:
return self.__api_request("http://"+url,method,**karg)
except requests.exceptions.ConnectionError as e:
raise RuntimeError("Couldn't connect to server (unreachable). Check your network")
except KeyError as e:
raise RuntimeError("Invalid method name '%s' in api.json" % method)
评论列表
文章目录