VOOZH about

URL: https://deepwiki.com/hypervel/http-client/2-installation-and-setup

⇱ Installation and Setup | hypervel/http-client | DeepWiki


Loading...
Menu

Installation and Setup

This document covers the installation of the hypervel/http-client package via Composer and the basic configuration requirements needed to start making HTTP requests. For information about making your first HTTP request, see the Quick Start Guide. For detailed configuration of advanced features like connection pooling and middleware, see Advanced Features.

System Requirements

The hypervel/http-client package requires specific versions of PHP and several dependencies to function correctly.

PHP Version Requirements

RequirementVersion
PHP8.2 or higher

Required Dependencies

The package automatically installs the following dependencies:

PackageVersion ConstraintPurpose
hyperf/macroable~3.1.0Provides runtime method extension via Macroable trait
guzzlehttp/guzzle^7.8.2Core HTTP client implementation and PSR-7/PSR-18 support
guzzlehttp/uri-template^1.0URI template expansion per RFC 6570
hypervel/support^0.3Provides Collection class and helper functions

Dependency Resolution and Key Classes


Sources: composer.json28-34 src/Factory.php8-20 src/Factory.php34 src/Factory.php51 src/Factory.php404-409 src/Factory.php481-487

Installation via Composer

Basic Installation

Install the package using Composer in your project directory:


This command will automatically resolve and install all required dependencies based on the version constraints defined in the package.

Development Installation

For development purposes, you may want to install from the main branch:


The development branch is aliased to version 0.3-dev for compatibility with semantic versioning.

Composer Installation Process


Sources: composer.json1-2 composer.json23-27 composer.json28-34

Autoloading Configuration

The package uses PSR-4 autoloading standards. Once installed via Composer, all classes are automatically available under the Hypervel\HttpClient namespace.

Namespace to File Mapping

Fully Qualified Class NameFile Path
Hypervel\HttpClient\Factorysrc/Factory.php
Hypervel\HttpClient\PendingRequestsrc/PendingRequest.php
Hypervel\HttpClient\Responsesrc/Response.php
Hypervel\HttpClient\Requestsrc/Request.php
Hypervel\HttpClient\ResponseSequencesrc/ResponseSequence.php
Hypervel\HttpClient\ClientPoolProxysrc/ClientPoolProxy.php

The Composer autoloader maps the namespace Hypervel\HttpClient\ to the package's src/ directory. Accessing any class under this namespace will automatically load the corresponding file.

Class Autoloading Flow


Sources: composer.json23-27 src/Factory.php31

Verification

After installation, verify the package is properly installed by checking if the main classes are available:


Dependency Verification

You can also verify that all required dependencies are installed by checking the composer.lock file or running:


This will display the installed version and all resolved dependencies.

Initial Configuration

The hypervel/http-client package works out of the box without additional configuration. However, you may want to set up global defaults for your application.

Basic Usage Setup

The primary entry point is the Factory class, which can be accessed statically or instantiated:


Global Configuration Options

While not required for basic usage, you can configure global options such as:

  • Default timeout values
  • Base URIs for API endpoints
  • Default headers
  • Connection pooling settings

For detailed information about configuring these options, see Advanced Features.

Sources: composer.json23-27