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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: http_parse-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 282b76bf81dfff103199ad07b3f927d92cf14b69448848b992af8c7d4ef1cf7e
MD5 8956e7eb43cca7da4e70f57f44c1f178
BLAKE2b-256 9f2a7fbc3d2c191a8e760f322fa9d370a2f89db20c663d390b1d69888a6034db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: http_parse-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ae76531e4796f33d85bc966f3993a1d342c1c788e9d2a6142d2c5bd31bfc8e8
MD5 5521ac43906c04d45e4b7acf69a6c871
BLAKE2b-256 a1e8a2fa2d98e918878f62ef8d56b08c82c6d17f0629d8a661228f6475b3b604

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