Download the PHP package alanvdb/client without Composer
On this page you can find all versions of the php package alanvdb/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alanvdb/client
More information about alanvdb/client
Files in alanvdb/client
Package client
Short Description Basic HTTP client that automatically handles SSL certificate retrieval
License MIT
Informations about the package client
AlanVdb / HTTP Client
Overview
alanvdb/http-client
is a PSR-18 compliant HTTP client library that automatically handles SSL certificate retrieval for a given domain. It is built on top of Guzzle and is designed to simplify HTTP requests while ensuring secure connections by managing SSL certificates automatically.
Features
- PSR-18 Compliant: Integrates seamlessly with any PSR-18 HTTP client interface implementation.
- Automatic SSL Certificate Retrieval: Automatically fetches and stores SSL certificates for specified domains.
- Customizable SSL Certificate Fetcher: Easily customize the SSL certificate fetcher or extend it to meet specific needs.
- Factory Pattern: The
HttpClientFactory
allows for easy instantiation and dependency injection. - Built on Guzzle: Leverages Guzzle's powerful HTTP client capabilities.
- Easy to Use: Simple API for making HTTP requests and handling SSL certificates.
Installation
You can install this package via Composer:
For development purposes, you can install the development dependencies as well:
Usage
Basic Usage
Here is an example of how to use the HttpClient
to send a GET request to a domain:
Handling SSL Certificates
The HttpClient
automatically fetches the SSL certificate for the domain specified in the request and saves it to the directory you provide. This ensures secure connections without manual certificate management.
Custom SSL Certificate Fetcher
You can also customize the SSL certificate fetching process by providing your implementation of the SslCertificateFetcherInterface
:
Using the Factory Pattern
The HttpClientFactory
provides a convenient way to create an HttpClient
instance:
Running Tests
To run the tests, you need to install the development dependencies first:
Then, you can run the tests using PHPUnit:
License
This project is licensed under the MIT License. See the LICENSE file for details.