]>
jfr.im git - z_archive/twitter.git/blob - twitter/auth.py
2 from base64
import encodestring
6 ABC for Authenticator objects.
9 def encode_params(self
, base_url
, method
, params
):
10 """Encodes parameters for a request suitable for including in a URL
11 or POST body. This method may also add new params to the request
12 if required by the authentication scheme in use."""
13 raise NotImplementedError()
15 def generate_headers(self
):
16 """Generates headers which should be added to the request if required
17 by the authentication scheme in use."""
18 raise NotImplementedError()
23 No authentication authenticator.
28 def encode_params(self
, base_url
, method
, params
):
29 return urllib
.urlencode(params
)
31 def generate_headers(self
):