Skip to main content

The set of standard http constants for headers and statuses

Project description

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'

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

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.

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