Skip to main content

A simple HTTP request parser.

Project description

HTTP Parse

A lightweight Python library for parsing raw HTTP requests.

Installation

pip install http-parse

Usage

from http_parse import parse

raw_request = """
GET /path HTTP/1.1
Host: example.com
User-Agent: curl/8.5.0

{"data": "example"}
"""

parsed = parse(raw_request)
print(parsed.headers)  # Access headers
print(parsed.body)     # Access body
print(parsed.url)      # Access URL

Features

  • Parse HTTP headers into a dictionary
  • Access request body
  • Access and modify headers
  • Extract URL and HTTP method

License

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

http_parse-0.1.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

http_parse-0.1.3-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: http_parse-0.1.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for http_parse-0.1.3.tar.gz
Algorithm Hash digest
SHA256 751bb72c2ce4ac86e873d8b41e7b1169f245f601c18161ee3b7da7e202f46d3f
MD5 46c0ec73b8289163e6b6d95ad8b1ecdb
BLAKE2b-256 891d1091bcc05ffddf6def4fd2c0e2ed5d3be7a7e83600d4326de459d5798ac4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: http_parse-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for http_parse-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fe335205dc9a812de1709c0d4d33df20136f8a43a20578ea763ce43bfa46f310
MD5 9b61ae5a72f5f3a8ce83742a0fb0ba84
BLAKE2b-256 50f20a227a101505a7ed60d200c0573da015b0126f55c942b33670e526b9e6e9

See more details on using hashes here.

Supported by

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