Advertisements

Tag archive for: requests

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 download a file via HTTP POST and HTTP GET with Python 3 requests library

When you are building a HTTP client with Python 3, you could be coding it to upload a file to a HTTP server or download a file from a HTTP server.

Previously, we discussed how to upload a file and some data through HTTP multipart in Python 3 using the requests library. In this post, let’s see how we can download a file via HTTP POST and HTTP GET.

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