Skip to main content

Http Constants

A set of constants for HTTP statuses and headers.

Installation

You can install Http Constants from PyPI:

pip install http-constants

The library is supported on Python 3.7+.

Usage

Headers

from http_constants.headers import HttpHeaders

>>> HttpHeaders.ACCEPT
'Accept'

>>> HttpHeaders.CONTENT_TYPE_VALUES.json
'application/json'

Statuses

from http_constants.status import HttpStatus

>>> HttpStatus.SERVICE_UNAVAILABLE
<HttpStatus.SERVICE_UNAVAILABLE: (503, 'Service Unavailable')>

>>> HttpStatus.SERVICE_UNAVAILABLE.value
503

>>> int(HttpStatus.SERVICE_UNAVAILABLE)
503

>>> HttpStatus.SERVICE_UNAVAILABLE.reason_phrase
'Service Unavailable'

>>> str(HttpStatus.SERVICE_UNAVAILABLE)
'503 SERVICE_UNAVAILABLE'

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

http-constants-0.5.0.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file http-constants-0.5.0.tar.gz.

File metadata

  • Download URL: http-constants-0.5.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for http-constants-0.5.0.tar.gz
Algorithm Hash digest
SHA256 151cb595a0964110ee51e1f5bf09c1b30b025de37f32688f3d0ca58fc8dae43e
MD5 ed62a182a77cbb655b2b6d29549c5257
BLAKE2b-256 d5333d45bce979cbcb87e9390240b2f2446a43f38816fc64ca084c2eb305c7c4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 file

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page