]>
jfr.im git - z_archive/twitter.git/blob - twitter/auth.py
2 import urllib
.parse
as urllib_parse
4 import urllib
as urllib_parse
6 from base64
import encodestring
10 ABC for Authenticator objects.
13 def encode_params(self
, base_url
, method
, params
):
14 """Encodes parameters for a request suitable for including in a URL
15 or POST body. This method may also add new params to the request
16 if required by the authentication scheme in use."""
17 raise NotImplementedError()
19 def generate_headers(self
):
20 """Generates headers which should be added to the request if required
21 by the authentication scheme in use."""
22 raise NotImplementedError()
27 No authentication authenticator.
32 def encode_params(self
, base_url
, method
, params
):
33 return urllib_parse
.urlencode(params
)
35 def generate_headers(self
):