Skip to main content

No project description provided

Project description

PyHostr

Handle HTTP GET and POST requests in Python.

Installation

pip install pyhostr

Usage

from pyhostr import PyHostr

# Instantiating the server
server = PyHost("localhost", 8080)

# Creating a GET route
server.get(route="/", response_headers={"Content-type": "text/html"},
            response="<h2>INDEX PAGE</h2>")

# Creating a POST route
server.post(
    route="/post", response_headers={"Content-type": "application/json"}, handler=handler_func)

# Finally, start the server
server.serve()

License

MIT Sami Hindi 2022 (c)

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

PyHostr-0.4.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file PyHostr-0.4.tar.gz.

File metadata

  • Download URL: PyHostr-0.4.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.5

File hashes

Hashes for PyHostr-0.4.tar.gz
Algorithm Hash digest
SHA256 42098d5f58f2a41a55a4ae9d1a12eb8110e2f474770611d6cab2cb5786e4f43e
MD5 9f3ca17783db5d6ad804828a415a5d72
BLAKE2b-256 544146453778ceb0f68b26ff298cb1c26a48903ccbfe1b73390279645685d612

See more details on using hashes here.

Supported by

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