HTTP methods that python supports
Project description
HTTP Request Methods
HTTP verbs that python core's HTTP parser supports.
This module provides an export that is just like HTTP request methods from Developer Mozilla, with the following differences:
- All method names are lower-cased.
- All method names are upper-cased.
HTTP Status Codes
Also this module provides a list with all HTTP Status Codes and you can get only status description by status code or get all status.
We use the methods package from Node.js as inspiration
Install
Install and update using Pip:
$ pip install httpmethods
API
import httpmethods as methods
A Simple Example
from httpmethods import get_http_methods
for method in get_http_methods():
print(method)
$ get
$ post
$ put
$ delete
$ ...
from httpmethods import get_http_methods
for _method in get_http_methods(uppercase=True):
print(_method)
$ GET
$ POST
$ PUT
$ DELETE
$ ...
from httpmethods import get_status_codes, get_status_by_code
print(get_status_by_code(200))
print(get_status_by_code(401))
print(get_status_codes())
$ 200 OK
$ 401 Unauthorized
$ {
$ 100: "100 Continue",
$ 101: "101 Switching Protocols",
$ 103: "103 Early Hints",
$ ...
$ }
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
httpmethods-1.0.5.tar.gz
(3.4 kB
view details)
File details
Details for the file httpmethods-1.0.5.tar.gz
.
File metadata
- Download URL: httpmethods-1.0.5.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce2c4b14a470fc2d07ca3e0e47d23922c257b187d6637692beef311f12e42929 |
|
MD5 | 8444794a01ce897324e29e138b793115 |
|
BLAKE2b-256 | 9284a89e1a205dd71a8b9f17b6f8a4f4007e5418aa7e6b94969f4d45301b71d3 |