https://github.com/fujiwarachoki/pyhostr
A hosting library with routing for Python
https://github.com/fujiwarachoki/pyhostr
http python wrapper
Last synced: 9 months ago
JSON representation
A hosting library with routing for Python
- Host: GitHub
- URL: https://github.com/fujiwarachoki/pyhostr
- Owner: FujiwaraChoki
- License: mit
- Created: 2022-12-03T21:14:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T21:16:58.000Z (about 3 years ago)
- Last Synced: 2025-06-02T16:29:45.779Z (10 months ago)
- Topics: http, python, wrapper
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PyHostr
Handle HTTP GET and POST requests in Python.
## Installation
```bash
pip install PyHostr
```
## Usage
```python
from PyHostr import PyHostr
# Instantiating the server
server = PyHostr("localhost", 8080)
# Creating a GET route
server.get(route="/", response_headers={"Content-type": "text/html"},
response="
INDEX PAGE
")
# 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)](LICENSE.txt)