Advertisements

Tag archive for: HTTP request

How to send an HTTP request to a HTTP Basic Authentication endpoint in Python 3 with requests library

When you are building a Python 3 application for the Internet, you could encounter API endpoints that use HTTP Basic Authentication as the authentication mechanism.

In such a situation, using the requests library in your Python 3 code makes it easier to communicate with those endpoints.

In case you need to build a Python 3 application that sends HTTP request to a HTTP Basic Authentication endpoint, this is how you can do so with the requests library.

Advertisements

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.

For example, when we want to upload a file and some data from to a HTTP server, we do so through a HTTP multipart request.

So how can we do that in Python? In Python 3, we can use the services of the requests library to help us construct HTTP multipart request easily.

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

Advertisements
Advertisements