Python 3.5 使用 Requests 库发送 POST 请求到 http://192.168.1.81:8081/auth/sign/in
本文将介绍使用 Python 3.5 和 Requests 库发送 POST 请求到 http://192.168.1.81:8081/auth/sign/in 接口,并输出返回结果。
import requests
url = 'http://192.168.1.81:8081/auth/sign/in'
data = {
'username': 'Admin',
'password': 'ITIM_p@ssw0rd1',
'captcha': '',
'hash': ''
}
response = requests.post(url, data=data)
result = response.json()
print(result)
请注意,这段代码假设您已经安装了 Requests 库。您可以使用以下命令来安装:
pip install requests
如果您在运行时遇到任何问题,请确保您的网络连接正常,并检查 URL 是否正确。
原文地址: https://www.cveoy.top/t/topic/TwV 著作权归作者所有。请勿转载和采集!