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.
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 getHttpMethods
for method in getHttpMethods():
print(method)
$ get
$ post
$ put
$ delete
$ ...
from httpmethods import getHttpMethods
for method in getHttpMethods(uppercase=True):
print(method)
$ GET
$ POST
$ PUT
$ DELETE
$ ...
from httpmethods import getStatusCodes, getStatusByCode
print(getStatusByCode(200))
print(getStatusByCode(401))
print(getStatusCodes())
$ 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.3.tar.gz
(3.3 kB
view hashes)