Make BaseAdapter describe the mandatory adapter interface (#3216)

* BaseAdapter definition of send is missing mandatory params

* Copy over relevant parts of the interface documentation

* Indentation fix

* Change base class documentation for close
This commit is contained in:
Seppo Yli-Olli
2016-05-24 21:23:16 +03:00
committed by Ian Cordasco
parent 49b69c4751
commit 9e9d2c6521
+15 -1
View File
@@ -54,10 +54,24 @@ class BaseAdapter(object):
def __init__(self):
super(BaseAdapter, self).__init__()
def send(self):
def send(self, request, stream=False, timeout=None, verify=True,
cert=None, proxies=None):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up, as a float, or a :ref:`(connect timeout,
read timeout) <timeouts>` tuple.
:type timeout: float or tuple
:param verify: (optional) Whether to verify SSL certificates.
:param cert: (optional) Any user-provided SSL certificate to be trusted.
:param proxies: (optional) The proxies dictionary to apply to the request.
"""
raise NotImplementedError
def close(self):
"""Cleans up adapter specific items."""
raise NotImplementedError