How to perform HTTP Basic Authentication with cURL?

To perform HTTP Basic Authentication using cURL, you need to specify the username and password as options when making the request. Here's an example:

curl -u username:password URL

Replace username and password with the appropriate values, and URL with the URL you want to send the request to.

For example, if the username is "admin", the password is "password123", and the URL is "https://example.com/api", the command would be:

curl -u admin:password123 https://example.com/api

cURL will include the appropriate headers in the request to perform the HTTP Basic Authentication.