8000 gh-91996: Adding an HTTPMethod StrEnum to http by cibofo · Pull Request #91997 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-91996: Adding an HTTPMethod StrEnum to http #91997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
correction and alphabetization
  • Loading branch information
ethanfurman committed May 5, 2022
commit 6c113feb6c0c1b0b6cb8bc877f25619c0986d126
2 changes: 1 addition & 1 deletion Doc/library/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Method Enum Name Details
``GET`` ``GET`` HTTP/1.1 :rfc:`7231`, Section 4.3.1
``HEAD`` ``HEAD`` HTTP/1.1 :rfc:`7231`, Section 4.3.2
``POST`` ``POST`` HTTP/1.1 :rfc:`7231`, Section 4.3.3
``PUT`` ``DELETE`` HTTP/1.1 :rfc:`7231`, Section 4.3.4
``PUT`` ``PUT`` HTTP/1.1 :rfc:`7231`, Section 4.3.4
``DELETE`` ``DELETE`` HTTP/1.1 :rfc:`7231`, Section 4.3.5
``CONNECT`` ``CONNECT`` HTTP/1.1 :rfc:`7231`, Section 4.3.6
``OPTIONS`` ``OPTIONS`` HTTP/1.1 :rfc:`7231`, Section 4.3.7
Expand Down
19 changes: 9 additions & 10 deletions Lib/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,15 @@ class HTTPMethod:
def __new__(cls, value, description):
obj = str.__new__(cls, value)
obj._value_ = value

obj.description = description
return obj

GET = 'GET', 'Transfer a current representation of the target resource.'
HEAD = 'HEAD', 'Same as GET, but only transfer the status line and header section.'
POST = 'POST', 'Perform resource-specific processing on the request payload.'
PUT = 'PUT', 'Replace all current representations of the target resource with the request payload.'
DELETE = 'DELETE', 'Remove all current representations of the target resource.'
CONNECT = 'CONNECT', 'Establish a tunnel to the server identified by the target resource.'
OPTIONS = 'OPTIONS', 'Describe the communication options for the target resource.'
TRACE = 'TRACE', 'Perform a message loop-back test along the path to the target resource.'
PATCH = 'PATCH', 'Apply partial modifications to a resource.'
CONNECT = 'CONNECT', 'Establish a connection to the server.'
DELETE = 'DELETE', 'Remove the target.'
GET = 'GET', 'Retrieve the target.'
HEAD = 'HEAD', 'Same as GET, but only retrieve the status line and header section.'
OPTIONS = 'OPTIONS', 'Describe the communication options for the target.'
PATCH = 'PATCH', 'Apply partial modifications to a target.'
POST = 'POST', 'Perform target-specific processing with the request payload.'
PUT = 'PUT', 'Replace the target with the request payload.'
TRACE = 'TRACE', 'Perform a message loop-back test along the path to the target.'
0