PHPackages                             givanov95/typed-http - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. givanov95/typed-http

ActiveLibrary[HTTP &amp; Networking](/categories/http)

givanov95/typed-http
====================

A typed HTTP request/response library for PHP

v0.1.11-alpha(6mo ago)016MITPHPPHP ^8.2

Since Nov 11Pushed 2mo agoCompare

[ Source](https://github.com/givanov95/typed-http)[ Packagist](https://packagist.org/packages/givanov95/typed-http)[ RSS](/packages/givanov95-typed-http/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

TypedHttp
=========

[](#typedhttp)

TypedHttp is a typed PHP HTTP request/response library designed to simplify building HTTP requests, parsing responses, and handling authentication.

Features
--------

[](#features)

- Abstract base Request class for typed HTTP requests
- Extensible authentication mechanisms (BasicAuth, Certificate, etc.)
- Support for various Content-Type and response formats
- Clear and informative exception handling
- Easily extendable for custom API integrations

Request parameters are automatically gathered from the **public properties declared in your extending request class**. You simply declare the parameters as public properties in your class, and the library handles collecting and sending them with your request, keeping your code clean and simple.

Installation
------------

[](#installation)

```
composer require givanov95/typed-http

use Givanov95\TypedHttp\Requests\Request;
use Givanov95\TypedHttp\Requests\Authorization\BasicAuth\BasicAuthAuthenticator;
use Givanov95\TypedHttp\Requests\Authorization\AuthenticatorInterface;

class MyRequest extends Request implements BasicAuthInterface
{
    // Required param for the request
    public string $param1 = null;

    // Optional param for the request
    public ?int $param2 = null;

    public function __construct(
        ?string $param1 = null,
        ?int $param2 = null
    )
    {
        parent::__construct();

        $this->param1 = $param1;
        $this->param2 = $param2;
    }

    public function getAuthenticator(): BasicAuthAuthenticator
    {
        return new BasicAuthAuthenticator('username', 'password');
    }

    public function getUrl(): Url
    {
        return new Url('https://api.example.com/data');
    }

    protected function getHttpMethodType(): HttpMethod
    {
        return HttpMethod::POST;
    }

    protected function getContentType(): ContentType
    {
        return ContentType::JSON;
    }

    protected function getExpectedResponseFormat(): ExpectedResponseFormat
    {
        return ExpectedResponseFormat::JSON;
    }
}

// Params are set via public properties declared in your extending Request class
$request = new MyRequest(param1: 'value1', param2: 42);
$response = $request->executeRequest();
$data = $request->getParsedBody();

print_r($data);
```

Tests
-----

[](#tests)

Tests are not included yet but will be added in future releases to ensure quality and reliability.

Examples
--------

[](#examples)

More example scripts and detailed usage scenarios will be added soon to help you get started quickly.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

180d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13287f97da54a3ad2cc1fa53c3d048a92d7653a9645023ba5415acbeea209717?d=identicon)[givanov95](/maintainers/givanov95)

---

Top Contributors

[![givanov95](https://avatars.githubusercontent.com/u/63155374?v=4)](https://github.com/givanov95 "givanov95 (10 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/givanov95-typed-http/health.svg)

```
[![Health](https://phpackages.com/badges/givanov95-typed-http/health.svg)](https://phpackages.com/packages/givanov95-typed-http)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
