As was described in this answer i've implement HMAC-SHA1 signature method.
def sign_request():
from hashlib import sha1
import hmac
key = b"CONSUMER_SECRET&"
basestr = b"BASE_STRING"
hashed = hmac.new(key, basestr, sha1)
return hashed.digest().encode("base64").rstrip('\n')
But i've got AttributeError
, 'bytes' object has no attribute 'encode'
. As i understood, that is why i'm using Python3, but i don't know how to fix it.