是的大部分的http请求库都不够hacking 不过有w8ay师傅的hack-requests 但是我想造一个属于自己的轮子它将会足够简单足够hacking 用这个名字是因为我选择了urllib做为最底裤

作为一个脚本小子的http库

他将能够

  • 发送 GET POST HEAD Requests请求
  • 重放burp requests.raw请求包
  • 支持raw请求头 而不是字典
  • 支持Proxy
  • 得到完整的报文像burp 那样
  • 未完待续

是的一个脚本小子 想写一个http库 对了他将只支持python3 因为我也只支持python3

requests中自动通过网页编码解码的实现:

原来是通过正则在content中取的,之前D盾拦截页面乱码但是网页内提供了编码格式应该可以通过添加一条正则来解决这个问题(我是不是可以给requests 提一个issus 或者贡献一个pull)

oh no刚看到注释中 将要在requests中移除它 分解到 requests-toolbelt中 在 requests-toolbelt先获得该功能在进行reuqests的移除更新

def get_encodings_from_content(content):
"""Returns encodings from given content string. :param content: bytestring to extract encodings from.
"""
warnings.warn((
'In requests 3.0, get_encodings_from_content will be removed. For '
'more information, please see the discussion on issue #2266. (This'
' warning should only appear once.)'),
DeprecationWarning) charset_re = re.compile(r'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I)
pragma_re = re.compile(r'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I)
xml_re = re.compile(r'^<\?xml.*?encoding=["\']*(.+?)["\'>]') return (charset_re.findall(content) +
pragma_re.findall(content) +
xml_re.findall(content))

Hackurllib的更多相关文章

随机推荐

  1. 【dva】model中effects函数的解析

    结构 effects: { *pageQuery({ payload = {} }, { select, call, put }) { const res = yield call(pageQuery ...

  2. Python pyecharts绘制饼图

    一.pyecharts绘制饼图语法简介 饼图主要用于表现不同类目的数据在总和中的占比.每个的弧度不是数据量的占比pie.add()方法的用法add(name, attr, value, radius= ...

  3. 粒子群优化算法—Matlab

    PSO算法 clc; clear ; close ; %% Problem Definition CostFunction = @(x) sphere(x); % Cost Function nVar ...

  4. LuoguP7694 [COCI2009-2010#4] AUTORI 题解

    Content 科学论文会大量引用一些早期的著作,因此在一个论文中出现两种不同的命名约定并不少见.这两种不同的命名约定分别是: 长变体,由每个作者姓氏的完整单词由连字符连接而成,例如 Knuth-Mo ...

  5. LuoguP7127 「RdOI R1」一次函数(function) 题解

    Content 设 \(S_k\) 为直线 \(f(x)=kx+k-1\),直线 \(f(x)=(k+1)x+k\) 与 \(x\) 轴围成的三角形的面积.现在给出 \(t\) 组询问,每组询问给定一 ...

  6. 从go程序中发消息给winform(C#)

    背景: 1.服务端语言为GO,客户端语言为:C#(WinForm): 2.在客户端操执行长耗时任务时,服务器应该将后台日志或定时将心跳信息及时传递给客户端,这样方便用户查看服务器执行情况(重要). 一 ...

  7. JAVA实现QQ第三方登录

    首先在QQ互联: https://connect.qq.com/manage.html 申请账号,并且进行资料审核,同时创建应用(设置回调地址) 申请应用完后,会有app_ID.app_KEY等参数 ...

  8. Harry Potter and the Hide Story(hdu3988)

    Harry Potter and the Hide Story Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 ...

  9. Codeforces Round #358 (Div. 2) C. Alyona and the Tree

    C. Alyona and the Tree time limit per test 1 second memory limit per test 256 megabytes input standa ...

  10. 小试国产开源HTAP分布式NewSQL数据库TiDB-v5.3.0

    概述 定义 TiDB官网 https://pingcap.com/zh/ 最新版本为5.3.0 TiDB GitHub源码 https://github.com/pingcap/tidb TiDB是由 ...