The body needs to be a file-like stream containing data encoded using multipart/form-data notation.
from io import BytesIO
from pulsar.utils.httpurl import encode_multipart_formdata
files = {'testfile': b'svdhgscvhsgdvchsgcvhsavchvchsgdvcd'}
data, content_type = encode_multipart_formdata(files)
file_data = BytesIO(data)