PHPackages                             tyasa81/requestwrapper - 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. tyasa81/requestwrapper

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

tyasa81/requestwrapper
======================

Simple Request Wrapper

v1.1.2(1y ago)087[3 PRs](https://github.com/tyasa81/RequestWrapper/pulls)MITPHPPHP ^8.2CI passing

Since Sep 23Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/tyasa81/RequestWrapper)[ Packagist](https://packagist.org/packages/tyasa81/requestwrapper)[ Docs](https://github.com/tyasa81/requestwrapper)[ GitHub Sponsors]()[ RSS](/packages/tyasa81-requestwrapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (8)Used By (0)

Simple Request Wrapper
======================

[](#simple-request-wrapper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/620ff032f39bc3ef13712918b6bef1e2dd94b97e751a70adb39c0538f7cf1bdb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747961736138312f72657175657374777261707065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tyasa81/requestwrapper)[![GitHub Tests Action Status](https://camo.githubusercontent.com/87b25b7d2b35ee9b71c2e8b914365d7876d9fdeccec71bc4d1f24b816a02310a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f747961736138312f72657175657374777261707065722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tyasa81/requestwrapper/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/75662ccee7e2d5e69a4d425fe793fc37c385431d892dae9569c248503d4a9954/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f747961736138312f72657175657374777261707065722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/tyasa81/requestwrapper/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e3327145c62ddd3049a7d47c74947b71a0f6ca169f47be8a5aa2ae09f2a9142b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747961736138312f72657175657374777261707065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tyasa81/requestwrapper)

This is a wrapper for request using Guzzle and Curl. It is mainly used to simplify request code in a request heavy project that deals with cookies and proxy. Facade are made for backward compatiblity on previous project where a lot of static methods are used. Refactoring code into a service class and package are made since it made using Guzzle and Curl much cleaner even for projects that are not cookies or proxy centric.

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

[](#installation)

You can install the package via composer:

```
composer require tyasa81/requestwrapper
```

You can publish the config file with:

```
php artisan vendor:publish --tag="requestwrapper-config"
```

Usage
-----

[](#usage)

Using Facades:

```
use tyasa81\RequestWrapper\Facades\RequestWrapper;
$response = RequestWrapper::getUrl("https://httpbin.org/ip",true);
dd($response);
```

Available functions:

```
    public static function postUrl($url, $payload, $json=false, &$args=array(), $retry=1, $sleep=1, $timeout=15, $type="POST")
    public static function getUrl($url, $json=false, &$args=array(), $retry=1, $sleep=1, $timeout=15)
    public static function postMultiPartUrl($url, $multipart, $json=false, &$args=array(), $retry=1, $sleep=1, $timeout=15, $type="POST")
    public static function getAsync($url_datas, $json=false, $args=array(), $timeout=15)
    public static function UrlwithProxy($url, $json=false, &$args=array(), $proxy_type="FAST", $type="GET", $retry=5, $sleep=0, $timeout=15)
    public static function requestCurlProxyRetry($url, $payload, $json=false, &$args=array(), $type="GET", $proxy_type="GLOBAL", $proxy_index=null, $timeout=20,$retry = 4)
    public static function requestCurlProxy($url, $payload, $json=false, &$args=array(), $type="GET", $proxy_type="GLOBAL", $proxy_index=null, $timeout=20)
    public static function requestCurl($url, $payload, $json=false, &$args=array(), $type="GET", $proxy_type=null, $proxy_index=null, $timeout=15,$retry=0,$sleep=0)

    // Helpers Functions
    public static function formatCookieJarToString(CookieJar $cookieJar)
    public static function getCookieValue(CookieJar $cookieJar, string $cookieName)
    public static function convertGuzzleCookieJarToSession(CookieJar $cookieJar)
    public static function getCookieJarFromSession(string $session)
```

Using Service Class:

```
    $curlwrapper = new CurlWrapper(cookieJar: $cookieJar);
    $response = $curlwrapper->request(url: "https://httpbin.org/ip", json: true);
```

OR

```
    $guzzlewrapper = new GuzzleWrapper(cookieJar: $cookieJar);
    $response = $guzzlewrapper->request(url: "https://httpbin.org/ip", json: true);
```

Interface:

```
    request(string $url, $payload=null, bool $json=false, array $headers=array(), string $type="POST", string $proxy_type=null, int $proxy_index=null, int $retry=1, int $sleep=1, int $timeout=15, bool $allow_redirects=null, bool $decode_content=null)
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Tony Yasa](https://github.com/tyasa81)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance67

Regular maintenance activity

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

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

Every ~17 days

Total

4

Last Release

552d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bf2677afb69b7f20b48a9a66bde2626a82c5536e6fc764884db5664979768fa?d=identicon)[tyasa81](/maintainers/tyasa81)

---

Top Contributors

[![tyasa81](https://avatars.githubusercontent.com/u/36804374?v=4)](https://github.com/tyasa81 "tyasa81 (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelTony Yasarequestwrapper

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tyasa81-requestwrapper/health.svg)

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

###  Alternatives

[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[pusher/pusher-http-laravel

\[DEPRECATED\] A Pusher bridge for Laravel

400509.0k3](/packages/pusher-pusher-http-laravel)[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.

29428.0k](/packages/sunchayn-nimbus)[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)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[pdphilip/cf-request

Cloudflare Laravel Request

2725.6k1](/packages/pdphilip-cf-request)

PHPackages © 2026

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