PHPackages                             agsystemspl/abstract-rest-client - 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. agsystemspl/abstract-rest-client

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

agsystemspl/abstract-rest-client
================================

PHP (Guzzle) API Wrapper

1.1.0(5mo ago)066↓66.7%1MITPHPPHP &gt;=7.0

Since Jan 16Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/agsystemspl/abstract-rest-client)[ Packagist](https://packagist.org/packages/agsystemspl/abstract-rest-client)[ RSS](/packages/agsystemspl-abstract-rest-client/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

Abstract REST Client
====================

[](#abstract-rest-client)

Overview
--------

[](#overview)

A PHP (Guzzle) API Wrapper designed for simplicity and extensibility. This library provides an elegant, fluent, chainable interface for constructing complex API endpoints and handling various HTTP methods.

Features
--------

[](#features)

- 🔗 Fluent, chainable API design
- 🌐 Supports GET, POST, PUT, PATCH, DELETE, HEAD methods
- 🔧 Highly customizable and extensible
- 🔒 Safe URL encoding and path construction
- 📦 Flexible options management
- 🚀 Built on top of Guzzle HTTP

Requirements
------------

[](#requirements)

- PHP 7.0+
- Guzzle HTTP (^6.0 or ^7.0)

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

[](#installation)

Install via Composer:

```
composer require agsystemspl/abstract-rest-client
```

Basic Usage
-----------

[](#basic-usage)

### Extending the Abstract Client

[](#extending-the-abstract-client)

```
use AGSystemsPl\RestClient\AbstractClient;

class MyApiClient extends AbstractClient
{
    protected function clientOptions(): array
    {
        return [
            'base_uri' => 'https://api.example.com/v1/'
        ];
    }
}

$client = new MyApiClient();

// Fluent path and method chaining
$response = $client->users->123->get(['format' => 'json']);
```

### Key Concepts

[](#key-concepts)

#### Path Construction

[](#path-construction)

- Use property access or method calls to build paths
- Segments are automatically URL-encoded
- Null, false, and empty values are filtered out

#### Request Methods

[](#request-methods)

```
// GET request
$client->users->get();

// POST request with JSON body
$client->users->post(['name' => 'John']);

// PUT request
$client->users->123->put(['name' => 'Updated']);

// DELETE request
$client->users->123->delete();
```

### Options Management

[](#options-management)

```
// Set initial options
$client = new MyApiClient([
    'timeout' => 10,
    'verify' => false
]);

// Replace all options
$client->withOptions(['new' => 'configuration']);

// Merge additional options
$client->appendOptions(['extra' => 'settings']);
```

Advanced Customization
----------------------

[](#advanced-customization)

Extend the abstract class to add custom behavior:

```
class MyCustomClient extends AbstractClient
{
    // Override path handling
    protected function handlePath($segments): string
    {
        // Custom path processing logic
        return parent::handlePath($segments);
    }

    // Custom response processing
    protected function handleResponse($response)
    {
        // Custom logic, e.g., XML parsing
        return $response;
    }
}
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

Distributed under the MIT License. See `LICENSE` for more information.

Contact
-------

[](#contact)

agsystems.pl -

Project Link:

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance70

Regular maintenance activity

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84% 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

168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2fd1f00ee39ad7a0b7b53414ecfceccd7e7444985f1c294105af3696bfd4776?d=identicon)[agsystems](/maintainers/agsystems)

---

Top Contributors

[![stonekins](https://avatars.githubusercontent.com/u/234693457?v=4)](https://github.com/stonekins "stonekins (21 commits)")[![krzysztofgwiazda](https://avatars.githubusercontent.com/u/1054403?v=4)](https://github.com/krzysztofgwiazda "krzysztofgwiazda (2 commits)")[![mindc](https://avatars.githubusercontent.com/u/1355190?v=4)](https://github.com/mindc "mindc (2 commits)")

---

Tags

psr-7http clientpsr-18REST APIapi clienthttp requestrest-clientfluent-interfaceguzzle-wrapperchainable-apiphp-rest-client

### Embed Badge

![Health badge](/badges/agsystemspl-abstract-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/agsystemspl-abstract-rest-client/health.svg)](https://phpackages.com/packages/agsystemspl-abstract-rest-client)
```

###  Alternatives

[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

32041.3k](/packages/sunchayn-nimbus)[amphp/http-client-psr7

PSR-7 adapter for Amp's HTTP client.

1381.0k8](/packages/amphp-http-client-psr7)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

157.1k](/packages/art4-requests-psr18-adapter)

PHPackages © 2026

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