首页 > 编程语言 > 详细

python安全之requests模块

时间:2020-02-29 21:24:15      阅读:72      评论:0      收藏:0      [点我收藏+]

安装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#查看请求头

python安全之requests模块

原文:https://www.cnblogs.com/d-uan/p/12385957.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!