Commit 13cae9ed by jiaqiying

fix bug

parent ccdd341b
......@@ -18,8 +18,8 @@ def request_main(url, headers, method, data):
if method.upper() == "GET":
res = requests.get(url=url, headers=headers, params=data)
elif method.upper() == "POST":
if header_content_type in ["application/x-www-form-urlencoded"]: #
res = requests.post(url=url, headers=headers, )
if header_content_type in ["application/x-www-form-urlencoded"]:
res = requests.post(url=url, headers=headers, data=data)
elif header_content_type == "application/json":
res = requests.post(url=url, headers=headers, data=json.dumps(data))
except Exception as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment