Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.06 KB

README.md

File metadata and controls

41 lines (27 loc) · 1.06 KB

backports.httpmethod

PyPI - Version PyPI - Python Version

A backport of Python 3.11+ http.HTTPMethod enum for Python 3.7+.


Table of Contents

Installation

pip install backports.httpmethod

Usage

import sys

if sys.version_info >= (3, 11):
    from http import HTTPMethod
else:
    from backports.httpmethod import HTTPMethod


HTTPMethod.GET == 'GET'  # True
HTTPMethod.GET.value  # 'GET'
HTTPMethod.GET.description  # 'Retrieve the target.'
list(HTTPMethod)[:3] # [<HTTPMethod.GET: 'GET'>, <HTTPMethod.HEAD: 'HEAD'>, <HTTPMethod.POST: 'POST'>]

License

backports-httpmethod is distributed under the terms of the MIT license.