python安全之requests模块

安装requests

python3默认安装了pip,进入该文件夹,输入命令pip install requests

在pycharm中完成需按alt+enter

使用该模块完成get/post请求,通过代理实现,配合burpsuit易于观察

如:#coding=utf-8
import requests

url = "https://www.baidu.com"

proxies={
"http":"http://127.0.0.1:8080",
"https":"http://127.0.0.1:8080"
}

requests.packages.urllib3.disable_warnings()#该语句用来解决InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised.
r = requests.post(url,data=name,proxies=proxies,verify=False)
r.text/content#查看源码

r.requests.header#查看请求头

猜你喜欢

转载自www.cnblogs.com/d-uan/p/12385957.html