Added a b64_encoded parameter to determine whether content needs to be decoded from base64 or not.