---
source: https://iinventedlight.com/library/notes/python-http.md
title: "Python http: HTTPStatus, HTTPMethod, and the standard HTTP submodules"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, http — HTTP modules; CPython, http documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-27
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-27
as_of: 2026-11-27
confidence: medium
untested: "Not reproduced (2026-11-27). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-http"
tags: [python, http, httpstatus, httpmethod, http-client]
client: Librarian
sources:
  - id: S1
    title: "http — HTTP modules"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/http.html
    accessed: 2026-11-27
    license: "PSF License Version 2"
  - id: S2
    title: "http documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/http.rst
    accessed: 2026-11-27
    license: "PSF License Version 2"
---
# Python http: HTTPStatus, HTTPMethod, and the standard HTTP submodules
**Answer:** The http package collects several modules for working with the HyperText Transfer Protocol, plus the HTTPStatus and HTTPMethod enums.

## Submodules

http.client speaks HTTP at a low level. For high-level URL opening, use urllib.request.

http.server also contains basic HTTP server classes based on socketserver. http.cookies also has utilities for implementing state management with cookies. http.cookiejar provides persistence of cookies.

## HTTPStatus

HTTPStatus was added in version 3.5. It is a subclass of enum.IntEnum that defines HTTP status codes, reason phrases, and long descriptions written in English.

The numeric value is 200, the phrase is OK, and the description is Request fulfilled, document follows.

The codes on the class are the IANA-registered status codes the docs list. list(HTTPStatus) starts with CONTINUE at 100 and SWITCHING_PROTOCOLS at 101.

## HTTPMethod

HTTPMethod was added in version 3.11. It is a subclass of enum.StrEnum that defines HTTP methods and descriptions written in English.

Its value is GET, and its description is Retrieve the target.

The documented methods are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, and QUERY. The list cites HTTP Semantics RFC 9110 for those methods, RFC 5789 for PATCH, and RFC 10008 for QUERY.

## See also

- [python-http-client](https://iinventedlight.com/library/notes/python-http-client/)
- [python-http-server](https://iinventedlight.com/library/notes/python-http-server/)
- [python-http-cookies](https://iinventedlight.com/library/notes/python-http-cookies/)

## Claims

- id: C1
  claim: http gathers several standard HTTP modules.
  source: S1
  evidence: "collects several modules for working with the"

- id: C2
  claim: HTTPStatus is an IntEnum of codes and phrases.
  source: S1
  evidence: "A subclass of enum.IntEnum that defines"

- id: C3
  claim: HTTPMethod was added in 3.11 as a StrEnum.
  source: S2
  evidence: "versionadded:: 3.11"

- id: C4
  claim: GET's description is Retrieve the target.
  source: S2
  evidence: "Retrieve the target."

- id: C5
  claim: http.client is low-level; urllib.request is the high-level opener.
  source: S1
  evidence: "low-level HTTP protocol client"

## Sources

- [S1] http — HTTP modules. Python Software Foundation. https://docs.python.org/3/library/http.html . License: PSF License Version 2. Accessed 2026-11-27.

- [S2] http documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/http.rst . License: PSF License Version 2. Accessed 2026-11-27.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, http — HTTP modules; CPython, http documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
