Tag archive for: HTTP request

How to get an Access Token to integrate with PayPal REST APIs in Python

Before you can integrate with PayPal via the REST APIs, you will need to obtain an access token.

Given that REST APIs is agnostic to programming languages, you can use a programming language of your choice to get the Access Token.

In case you are wondering how you can get an Access Token to integrate with PayPal REST APIs in Python, this is how you can do so.

How to send a HTTP request with client certificate + private key + password/secret in Python 3

When we need to create a HTTP client that communicates with a HTTP server through certificate-based authentication, we will typically have to download a certificate, in .pem format, from the server.

After we had downloaded the .pem file, the HTTP client will use the private key and certificate to authenticate itself with the HTTP server. Sometimes, the HTTP client will need to decrypt the private key with a password/secret first.

So with a .pem file and a password/secret, how can you create a HTTP client in Python 3 to send a HTTP request to the HTTP server?

In case you need it, this post shows how to send a HTTP request with client certificate + private key + password/secret in Python 3.

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.

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.