Skip to content

Commit 979a334

Browse files
committed
Documenting requirements for a custom HTTP object in Connection.
1 parent aaf8976 commit 979a334

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

gcloud/connection.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ class Connection(object):
3232
Subclasses may seek to use the private key from ``credentials`` to sign
3333
data.
3434
35+
A custom (non-``httplib``) HTTP object must have a ``request`` method
36+
which accepts the following arguments:
37+
38+
* ``uri``
39+
* ``method``
40+
* ``body``
41+
* ``headers``
42+
43+
In addition, ``redirections`` and ``connection_type`` may be used.
44+
45+
Without the use of ``credentials.authorize(http)``, a custom ``http``
46+
object will also need to be able to add a bearer token to API
47+
requests and handle token refresh on 401 errors.
48+
3549
:type credentials: :class:`oauth2client.client.OAuth2Credentials` or
3650
:class:`NoneType`
3751
:param credentials: The OAuth2 Credentials to use for this connection.

0 commit comments

Comments
 (0)