Is it possible that posting with `requests` and `MultipartEncoder` results in bad transfer or partial upload?

167 Views Asked by At

When trying to upload a file using request.post and MultipartEncoder, is it possible that the upload is bad and results in inconsistency between the original file and the received file? Do I need to do any integrity or validity check?

1

There are 1 best solutions below

1
Camaendir On

HTTP is usually used over TCP:

An HTTP client initiates a request by establishing a Transmission Control Protocol (TCP) connection HTTP Wikipedia

only some specific versions use UDP (see Wikipedia Article). TCP itself uses checksum fields to ensure correct transmission:

To assure correctness a checksum field is included TCP Wikipedia

So sending the file over HTTP results in a proper transmission and prevents inconsistencies between the original and the received file.

The Library you use should not have an impact on that. So if you use a standard library (as you do) it won’t.