mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Add Documentation for custom methods
This commit is contained in:
@@ -797,6 +797,24 @@ headers.
|
||||
Excellent. Time to write a Python program that abuses the GitHub API in all
|
||||
kinds of exciting ways, 4995 more times.
|
||||
|
||||
.. _custom-verbs:
|
||||
|
||||
Custom Verbs
|
||||
------------
|
||||
|
||||
From time to time you may be working with a server that, for whatever reason,
|
||||
allows use or even requires use of HTTP verbs not covered above. One example of
|
||||
this would be the MKCOL method some WEBDAV servers use. Do not fret, these can
|
||||
still be used with Requests. These make use of the built-in ``.request``
|
||||
method. For example::
|
||||
|
||||
>>> r = requests.request('mkcol', url, data=data)
|
||||
>>> r.status_code
|
||||
200 # Assuming your call was correct
|
||||
|
||||
Utilising this, you can make use of any method verb that your server allows.
|
||||
|
||||
|
||||
.. _link-headers:
|
||||
|
||||
Link Headers
|
||||
|
||||
Reference in New Issue
Block a user