def delete(self, id=None): self.json_data = requests.get(self.delete_url, params={ "access_token": WeWork.get_token(), "id": id }).json() self.verbose(self.json_data) return self.json_data
def list(self, id): self.json_data = requests.get(self.list_url, params={ "access_token": WeWork.get_token(), "id": id }).json() self.verbose(self.json_data) return self.json_data
def update(self, id, name, parentid, order): self.json_data = requests.post(self.update_url, headers=self.headers, params={ "access_token": WeWork.get_token() }, json={ "id": id, "name": name, "parentid": parentid, "order": order }).json() self.verbose(self.json_data) return self.json_data
def test_get_token(self): wework = WeWork() token = wework.get_token() assert token != None
def creat(self, name, parentid, order): self.json_data=requests.post(self.creat_url,headers=self.headers,params={"access_token":WeWork.get_token()},json={ "name": name, "parentid": parentid, "order": order, "id": None } # , # # proxies=self.proxies,verify=False )\ .json() self.verbose(self.json_data) return self.json_data