As you can see in Transform.perform_request from the Python elasticsearch client, body is specifically encoded to bytes. However, full_url is a Unicode str.
Since hashlib.md5() expects bytes, you need to encode self.full_url too using self.full_url.encode('ascii') since a well formatted URL cannot contain anything else than ASCII.
As you can see in Transform.perform_request from the Python elasticsearch client,
body
is specifically encoded tobytes
. However,full_url
is a Unicodestr
.Since
hashlib.md5()
expectsbytes
, you need to encodeself.full_url
too usingself.full_url.encode('ascii')
since a well formatted URL cannot contain anything else than ASCII.