1

I want to send a 'multipart/form-data' dictionary data without files

headers = {'key':'value', 'Content-Type':'multipart/form-data'}
data = {'api_key':'api_value', ... }

response = request.post('API_URL', headers=headers, data=data)

but API response is:

FileUploadException: the request was rejected because no multipart boundary was found

so I changed 'multipart/form-data' -> 'multipart/form-data; boundary=____sample' This code also didn't work. It didn't recognize the parameters.

How can I send 'multipart/form-data' requests without files?

Lucas
  • 13
  • 1
  • 3

1 Answers1

0

I'm not entirely sure how python works with requests. You can try this accepted answers or any which is suitable

python requests - POST Multipart/form-data without filename in HTTP request