예제 #1
0
 def send_post_bycookies(self, url, cookies, paramdata):
     header = {"Content-Type": "application/json", "csrfToken": "csrfToken"}
     res = requests.post(Common.baseUrl() + url,
                         data=json.dumps(paramdata),
                         headers=header,
                         cookies=cookies)
     return res.json()
예제 #2
0
 def send_get(self, url, paraData=None):
     res = requests.get(Common.baseUrl() + url, params=paraData)
     #return json.dumps(res.json(), indent=2, sort_keys=True)  # 把结果格式化输出
     return res.json()
예제 #3
0
 def send_post(self, url, paramdata):
     header = {"Content-Type": "application/json"}
     res = requests.post(Common.baseUrl() + url,
                         data=json.dumps(paramdata),
                         headers=header)
     return res.json()