Skip to main content

一个用于解析和发送HTTP请求的Python库,支持代理和保存响应

Project description

BurpHTTPRequest

一个简单易用的Python HTTP请求处理库,支持从文件读取请求、设置代理、保存响应等功能。

特性

  • 从文件读取HTTP请求
  • 支持设置HTTP代理
  • 支持设置Cookie
  • 自动处理响应编码
  • 支持保存响应内容到文件
  • 支持移除压缩编码

使用示例

更多实例见 test/main.py

pip install burphttp
from burphttp import burphttp

# 创建实例
bq = burphttp()

# 从文件读取请求
bq.parse_request_from_file("request.http")

# 设置代理(可选)
bq.set_proxy("http://127.0.0.1:8080")

# 设置Cookie(可选)
bq.set_cookie("session=abc123; user=test")

# 移除压缩编码(可选)
bq.fixEncoding()

# 发送请求
bq.send_request()

# 保存响应体到文件
bq.save_response_body("response.txt")

# 打印响应信息
print(bq.response_status_code)  # 状态码
print(bq.response_headers)      # 响应头
print(bq.response_body)         # 响应体

HTTP请求文件格式

请求文件格式示例:

POST /api/test HTTP/1.1
Host: example.com
Content-Type: application/json

{"key": "value"}

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

burphttp-0.1.3.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

burphttp-0.1.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file burphttp-0.1.3.tar.gz.

File metadata

  • Download URL: burphttp-0.1.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for burphttp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 23163e2b547468495e1970fd7b7a38d269eeb6e52a0e6a4ebe9a462aca4fb85a
MD5 edcb40d067f2bbded976c6c4b399fe09
BLAKE2b-256 fa267c81eadd1bfd9de11797d4dfba8e72aae316591b7abed1a9b4b472d4dc21

See more details on using hashes here.

File details

Details for the file burphttp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: burphttp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for burphttp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3c33314aae7fa3800851f49c0cc83018911d566fc005b91ccfe9d633820c93f1
MD5 0e2a5e4aab0d67c4c33674528511d829
BLAKE2b-256 1c9b1d9c9ad0ea94ebdb60c70bab10d898963c0bb898158bcd744906d19d2d68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page