PHPackages                             swnck/pure-request - 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. swnck/pure-request

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

swnck/pure-request
==================

A streamlined PHP library for hassle-free HTTP requests, simplifying web communication without the complexity of cURL.

1.0.1(2y ago)05Apache-2.0PHP

Since Mar 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/swnck/PureRequest)[ Packagist](https://packagist.org/packages/swnck/pure-request)[ RSS](/packages/swnck-pure-request/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PureRequest
===========

[](#purerequest)

⚠️ UNDER DEVELOPMENT ⚠️
-----------------------

[](#️-under-development-️)

Introduction
------------

[](#introduction)

`PureRequest` is a streamlined PHP library designed to simplify web communication by providing a hassle-free interface for HTTP requests, eliminating the complexity of using cURL directly. This library supports a wide range of HTTP operations, including GET and POST requests, and is highly configurable to meet the needs of various web applications.

Features
--------

[](#features)

- Easy-to-use interface for HTTP GET and POST requests
- Support for custom headers and body content
- Configurable request options, including timeouts and redirection handling
- Built-in support for handling response data and status codes
- Secure and efficient implementation

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

[](#installation)

To install PureRequest, you need to have Composer installed on your machine. Run the following command in your project directory:

```
composer require swnck/pure-request
```

Usage
-----

[](#usage)

### Configuration of Request

[](#configuration-of-request)

```
$request = new PureRequest((new RequestConfiguration())
    ->setReturnTransfer(true) // Return the transfer as a string of the return value of curl_exec() instead of outputting it out directly
    ->setFollowLocation(true) // Follow any "Location: " header that the server sends as part of the HTTP header (note this is recursive, PHP will follow as many "Location: " headers that it is sent, unless CURLOPT_MAXREDIRS is set)
    ->setConnectTimeout(10) // The maximum number of seconds to allow cURL functions to execute
);
```

or if you want to stay with DEFAULT configuration:

```
$request = new PureRequest();
```

### Sending a GET Request

[](#sending-a-get-request)

```
$request->get(HeaderContent::empty(), function (ResponseFrame $response) {
    echo $response->getContent();
    echo $response->getStatusCode();
}, "https://example.com/api/data");
```

### Sending a POST Request

[](#sending-a-post-request)

```
$request->post(HeaderContent::paste(["Content-Type" => ContentType::APPLICATION_JSON, "Connection" => "keep-alive"]), BodyContent::paste([
    "email" => "user@example.com",
    "password" => "your_password"
]), function (ResponseFrame $response) {
    echo $response->getContent();
}, "https://example.com/api/login");
```

Features
--------

[](#features-1)

- Easy-to-use interface for HTTP GET and POST requests
- Support for custom headers and body content
- Support for PUT, DELETE, PATCH, OPTIONS, HEAD, and other HTTP methods
- Support for file uploads and multipart form data
- Configurable request options, including timeouts and redirection handling
- Built-in support for handling response data and status codes
- Secure and efficient implementation
- Support for cookies and session management
- Support for asynchronous requests and parallel processing

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

[](#contributing)

We welcome contributions from the community! If you'd like to contribute to PureRequest, please fork the repository and submit a pull request with your proposed changes or improvements.

License
-------

[](#license)

The contents of this repository are licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

789d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/20395afc6189f39dfa52f4d98eb40898f538240ded9185a22ee9025d9b5f8f9c?d=identicon)[swnck](/maintainers/swnck)

---

Top Contributors

[![swnck](https://avatars.githubusercontent.com/u/83925560?v=4)](https://github.com/swnck "swnck (12 commits)")

### Embed Badge

![Health badge](/badges/swnck-pure-request/health.svg)

```
[![Health](https://phpackages.com/badges/swnck-pure-request/health.svg)](https://phpackages.com/packages/swnck-pure-request)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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