A backport of Python 3.11+ http.HTTPMethod
enum for Python 3.7+.
Table of Contents
pip install backports.httpmethod
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'>]
backports-httpmethod
is distributed under the terms of the MIT license.