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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: http_parse-0.1.0.tar.gz
  • Upload date:
  • Size: 2.0 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.0.tar.gz
Algorithm Hash digest
SHA256 51528e7ca9781797620c10564c22ddfbfc23045196a3ccea730fdd71b6b75078
MD5 caf2f96a9f04a36872a5c76e72900338
BLAKE2b-256 b4bc853bf80797d901c61ba613ad1ffd8ebe23a63a377cb6a688379578b88d54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: http_parse-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94c298c5392ee8b8d46c7913727c6c316164d7487ab9ef4579e8348c321ce4a4
MD5 1f9ef7bf14a7449b0c5a0bdc3eaa1edc
BLAKE2b-256 e9590ccd57836adbe6224704c343a3829a98b622f6ba40d43d1bb41e9723d955

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