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

Uploaded Source

Built Distribution

http_parse-0.1.4-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: http_parse-0.1.4.tar.gz
  • Upload date:
  • Size: 3.4 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.4.tar.gz
Algorithm Hash digest
SHA256 2fd545ff35273dce8eacf177a696586f04e7b3bc80b14511c6cd463ce9111540
MD5 a5bb0b7b9afeb611d9cad7e5eb5f2e56
BLAKE2b-256 34604c64d0bf143142a36398f491daaf38dbd7291ee5d019e993dd7b5d133246

See more details on using hashes here.

File details

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

File metadata

  • Download URL: http_parse-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 2.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 41f9dd4793bc6b6ac3e5fdbd1f3fc137018ffa7981cf6ef68b1e8b0742c1db5f
MD5 96ba9a23969cd305b82a75f68a675dac
BLAKE2b-256 7be08c5f22b2c029c75035cd21f0a4bdcb9b0b81d4b13536d43f1abc4c2a9f5d

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