Skip to main content

A backport of Python 3.11+ `http.HTTPMethod` enum

Project description

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.

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

backports_httpmethod-0.2.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

backports_httpmethod-0.2.0-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page