Tag archive for: HTTP multipart

How to upload a file and some data through HTTP multipart in Python 3 using the requests library

Undeniably, the HTTP protocol had become the dominant communication protocol between computers.

Through the HTTP protocol, a HTTP client can send data to a HTTP server. For example, a client can upload a file and some data from to a HTTP server through a HTTP multipart request.

If you are building that client with Python 3, then you can use the requests library to construct the HTTP multipart request easily.

In case you need it, this is how we can upload a file and some data through HTTP multipart in Python 3 using the requests library.

Uploading large HTTP multipart request with System.Net.HttpWebRequest in C#

My previous post described a method of sending a file and some data via HTTP multipart post by constructing the HTTP request with the System.IO.MemoryStream class before writing the contents to the System.Net.HttpWebRequest class. This method of sending our HTTP request will work only if we can restrict the total size of our file and data.