I see this error:
TypeError: a bytes-like object is required, not 'str'
python3.6/base64.py", line 58, in b64encode encoded = binascii.b2a_base64(s, newline=False)`
Here is the code:
import base64
import hmac
import hashlib
import binascii
....
def post(self,request):
body = str(request.body).encode()
sign_signature = base64.b64encode(hmac.new('tester'.encode(), body, hashlib.sha256).hexdigest())