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.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

http_parse-0.1.2-py3-none-any.whl (1.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: http_parse-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 aeca00bb93e59b54499c15b2e6f48cbecff41a48d0d7edb376a8589f1328fb14
MD5 c4f5998ef62c8bb46e3a375bbbbdaf3d
BLAKE2b-256 e4794152ffbe471f289a9197bdea2bbefff6a16a42e87f716f5bdebd27fcbaf0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: http_parse-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 578273b132ae26b69f81f1873bbef43ee03e94d44156cad405de80e10e5bfb6f
MD5 5356ed8e3b7b42fa3180cf5e94431548
BLAKE2b-256 1213f85383a1c450dcdde671938c8fba181b323cc8e4c82d032c7d4766904208

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