PHPackages                             joshuaify/guzzlelib - 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. [API Development](/categories/api)
4. /
5. joshuaify/guzzlelib

ActiveLibrary[API Development](/categories/api)

joshuaify/guzzlelib
===================

A wrapper library for Guzzle HTTP client

v1.0.0(1y ago)020MITPHPPHP ^7.2

Since Sep 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/joshuaify/Guzzlelib)[ Packagist](https://packagist.org/packages/joshuaify/guzzlelib)[ Docs](https://docs.pypapi.ng/guzzlelib/)[ RSS](/packages/joshuaify-guzzlelib/feed)WikiDiscussions main Synced 1mo ago

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

Guzzlelib
=========

[](#guzzlelib)

Guzzlelib is a PHP wrapper library for Guzzle HTTP client, providing a simplified interface for making HTTP requests. It offers an easy-to-use API for GET, POST, PUT, PATCH, and DELETE requests, with built-in error handling and response parsing.

This library can be used with PHP 7.2+ and is compatible with popular PHP frameworks, including Laravel, Symfony, CodeIgniter, Zend, Yii, CakePHP, and Slim. It's ideal for any PHP application that requires streamlined API communication.

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

[](#requirements)

- PHP 7.2 or higher
- Composer (for dependency management)
- Guzzle HTTP client

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

[](#installation)

You can install Guzzlelib using Composer. Run the following command in your project directory:

```
composer require joshuaify/guzzlelib

```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

First, include the Guzzlelib class in your PHP file:

```
use joshuaify\API\Guzzlelib;
```

or

```
require 'path/to/your/vendor/joshuaify/guzzlelib/src/Guzzlelib.php';
```

Then, create an instance of Guzzlelib:

```
$guzzlelib = new Guzzlelib([
    'base_uri' => 'https://api.example.com',
    'timeout' => 30.0,
    'headers' => [
        'Authorization' => 'Bearer your-token-here'
    ]
]);
```

### Making Requests

[](#making-requests)

#### GET Request

[](#get-request)

```
$response = $guzzlelib->getRequest('/users', ['page' => 1]);
```

#### POST Request

[](#post-request)

```
$response = $guzzlelib->postRequest('/users', [
    'name' => 'John Doe',
    'email' => 'john@example.com'
]);
```

#### PUT Request

[](#put-request)

```
$response = $guzzlelib->putRequest('/users/1', [
    'name' => 'Jane Doe'
]);
```

#### PATCH Request

[](#patch-request)

```
$response = $guzzlelib->patchRequest('/users/1', [
    'email' => 'jane@example.com'
]);
```

#### DELETE Request

[](#delete-request)

```
$response = $guzzlelib->deleteRequest('/users/1');
```

### Handling Responses

[](#handling-responses)

All request methods return an array with two keys: `code` and `body`.

- `code`: The HTTP status code of the response.
- `body`: The decoded JSON body of the response.

Example:

```
$response = $guzzlelib->getRequest('/users');

if ($response['code'] === 200) {
    $users = $response['body'];
    // Process $users data
} else {
    // Handle error
    echo "Error: " . json_encode($response['body']);
}
```

### Error Handling

[](#error-handling)

If a request fails, Guzzlelib will return an array with an `error` key set to `true` and a `message` describing the error.

```
$response = $guzzlelib->getRequest('/non-existent-endpoint');

if (isset($response['error']) && $response['error'] === true) {
    echo "Error occurred: " . $response['message'];
}
```

Configuration Options
---------------------

[](#configuration-options)

When initializing Guzzlelib, you can pass an array of configuration options:

- `base_uri`: The base URL for all requests.
- `timeout`: The timeout for requests in seconds.
- `headers`: An array of default headers to be sent with each request.
- `auth`: Authentication method (e.g., \['username', 'password'\] for Basic Auth).
- `proxy`: Proxy settings.
- `verify`: SSL certificate verification (set to `false` to disable).
- `connect_timeout`: The number of seconds to wait while trying to connect to a server.
- `cookies`: Set to `true` to use a shared cookie session, or provide an instance of `GuzzleHttp\Cookie\CookieJarInterface`.
- `allow_redirects`: Set to `false` to disable redirects.
- `debug`: Set to `true` to enable debug output.
- `http_errors`: Set to `false` to disable throwing exceptions on HTTP protocol errors (4xx and 5xx responses).

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This library is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

592d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35eb75e430162535825ae1383a7d4598f010056a57e1d6404e9d9f0720a8d499?d=identicon)[joshuaify](/maintainers/joshuaify)

---

Top Contributors

[![joshuaify](https://avatars.githubusercontent.com/u/25463603?v=4)](https://github.com/joshuaify "joshuaify (19 commits)")

---

Tags

phpapiclientlaravelcodeigniterapi-requestsjoshuaifyguzzlelib

### Embed Badge

![Health badge](/badges/joshuaify-guzzlelib/health.svg)

```
[![Health](https://phpackages.com/badges/joshuaify-guzzlelib/health.svg)](https://phpackages.com/packages/joshuaify-guzzlelib)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[google-gemini-php/laravel

Google Gemini PHP for Laravel is a supercharged PHP API client that allows you to interact with the Google Gemini AI API

614397.1k4](/packages/google-gemini-php-laravel)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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