PyDocs

Nav

Internet Protocols and Support

HTTPMethod

http

class · Added in 3.11 (source)
  • HTTPMethod(*values)
HTTP methods and descriptions

Methods from the following RFCs are all observed:

    * RFC 9110: HTTP Semantics, obsoletes 7231, which obsoleted 2616
    * RFC 5789: PATCH Method for HTTP
1 Example
>>> from http import HTTPMethod
>>>
>>> HTTPMethod.GET
<HTTPMethod.GET>
>>> HTTPMethod.GET == 'GET'
True
>>> HTTPMethod.GET.value
'GET'
>>> HTTPMethod.GET.description
'Retrieve the target.'
>>> list(HTTPMethod)
[<HTTPMethod.CONNECT>,
 <HTTPMethod.DELETE>,
 <HTTPMethod.GET>,
 <HTTPMethod.HEAD>,
 <HTTPMethod.OPTIONS>,
 <HTTPMethod.PATCH>,
 <HTTPMethod.POST>,
 <HTTPMethod.PUT>,
 <HTTPMethod.TRACE>]
from the Python docs
See Also
No see-alsos for http/HTTPMethod
0 Notes
No notes for HTTPMethod