PHPackages                             khalyomede/pulsar-php - 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. khalyomede/pulsar-php

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

khalyomede/pulsar-php
=====================

API request and response, without using CURL.

v3.6.0(7y ago)2541MITPHPPHP &gt;=7.2.0

Since Apr 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/khalyomede/pulsar-php)[ Packagist](https://packagist.org/packages/khalyomede/pulsar-php)[ RSS](/packages/khalyomede-pulsar-php/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (16)Used By (0)

Pulsar-php
==========

[](#pulsar-php)

API request and response, without using CURL.

[![Packagist](https://camo.githubusercontent.com/7dfd70f7d74af60b2b404075a95cc63711fc56d5c94efdf1296f56a24d2d1cc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616c796f6d6564652f70756c7361722d7068702e737667)](https://camo.githubusercontent.com/7dfd70f7d74af60b2b404075a95cc63711fc56d5c94efdf1296f56a24d2d1cc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b68616c796f6d6564652f70756c7361722d7068702e737667)[![PHP from Packagist](https://camo.githubusercontent.com/c9fd284a151a7ba8ccee6ddd0f696a6a4f622a3943b08fb194f6f0bd8e76cdea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616c796f6d6564652f70756c7361722d7068702e737667)](https://camo.githubusercontent.com/c9fd284a151a7ba8ccee6ddd0f696a6a4f622a3943b08fb194f6f0bd8e76cdea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b68616c796f6d6564652f70756c7361722d7068702e737667)[![Packagist](https://camo.githubusercontent.com/e562eab2ab28758b579fe4e9b6b1a0303014ed12bd3f851f4e5abe813c812955/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616c796f6d6564652f70756c7361722d7068702e737667)](https://camo.githubusercontent.com/e562eab2ab28758b579fe4e9b6b1a0303014ed12bd3f851f4e5abe813c812955/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b68616c796f6d6564652f70756c7361722d7068702e737667)

 [![Pulsar-PHP logo](https://user-images.githubusercontent.com/15908747/41560722-4848ca90-7348-11e8-9918-d22340703b2c.png)](https://user-images.githubusercontent.com/15908747/41560722-4848ca90-7348-11e8-9918-d22340703b2c.png)

Summary
-------

[](#summary)

- [Installation](#installation)
- [PHP support](#php-support)
- [Examples](#examples)
- [Credits](#credits)

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

[](#installation)

In your project, add the following dependency:

```
composer require khalyomede/pulsar-php:3.*
```

PHP support
-----------

[](#php-support)

To use this library for PHP 5.3+ until 5.6, use the version `1.*` of this library. Note the version 1 and 2 are no longer maintainted.

Examples
--------

[](#examples)

- [Sending a GET request](#sending-a-get-request)
- [Sending a POST request](#sending-a-post-request)
- [Sending a PATCH request](#sending-a-patch-request)
- [Sending a PUT request](#sending-a-put-request)
- [Sending a DELETE request](#sending-a-delete-request)
- [Sending a request to a non existing endpoint](#sending-a-request-to-a-non-existing-endpoint)
- [Get the response as an array](#get-the-response-as-an-array)
- [Get the HTTP status code](#get-the-http-status-code)

### Sending a GET request

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

```
require(__DIR__ . '/../vendor/autoload.php');

$content = pulsar()->get('https://jsonplaceholder.typicode.com/posts/1')->content();

print_r($content);
```

```
stdClass Object
(
  [userId] => 1
  [id] => 1
  [title] => sunt aut facere repellat provident occaecati excepturi optio reprehenderit
  [body] => quia et suscipit
suscipit recusandae consequuntur expedita et cum
reprehenderit molestiae ut ut quas totam
nostrum rerum est autem sunt rem eveniet architecto
)
```

### Sending a POST request

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

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->data([
  'title' => 'Test your PHP libraries with Matcha',
  'userId' => 1,
  'body' => 'Lorem ipsum'
])->post('https://jsonplaceholder.typicode.com/posts');

print_r($response->content());
```

```
stdClass Object
(
  [title] => Test your PHP libraries with Matcha
  [userId] => 1
  [body] => Lorem ipsum
  [id] => 101
)
```

### Sending a PATCH request

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

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->data([
  'name' => 'morpheus',
  'job' => 'zion resident'
])->patch('https://reqres.in/api/users/2');

print_r($response->content());
```

```
stdClass Object
(
  [name] => morpheus
  [job] => zion resident
  [updatedAt] => 2018-06-18T21:29:15.334Z
)
```

### Sending a PUT request

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

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->data([
    'name' => 'neo',
    'job' => 'developer at Metacortex'
])->put('https://reqres.in/api/users/2');

print_r($response->content());
```

```
stdClass Object
(
    [name] => neo
    [job] => developer at Metacortex
    [updatedAt] => 2018-06-20T09:46:44.267Z
)
```

### Sending a DELETE request

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

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->delete('https://reqres.in/api/users/2');

echo $response->code();
```

```
204
```

### Sending a request to a non existing endpoint

[](#sending-a-request-to-a-non-existing-endpoint)

In this case, you will always get a `404` status code and an empty response.

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->get('https://a-non-existing-domain-hopefully.com/api/v1/post');

echo $response->code();
```

```
404
```

### Get the response as an array

[](#get-the-response-as-an-array)

You can do so by using `->toArray()` modifier:

```
require(__DIR__ . '/../vendor/autoload.php');
```

### Get the response as an array

[](#get-the-response-as-an-array-1)

You can use the `toArray()` modifier for this purpose:

```
require(__DIR__ . '/../vendor/autoload.php');

$array = pulsar()->get('https://jsonplaceholder.typicode.com/posts/1')->toArray()->content();

print_r($array);
```

Which is the same as:

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->get('https://jsonplaceholder.typicode.com/posts/1');

$array = $response->toArray()->content();

print_r($array);
```

```
Array
(
  [userId] => 1
  [id] => 1
  [title] => sunt aut facere repellat provident occaecati excepturi optio reprehenderit
  [body] => quia et suscipit
suscipit recusandae consequuntur expedita et cum
reprehenderit molestiae ut ut quas totam
nostrum rerum est autem sunt rem eveniet architecto
)
```

### Get the HTTP status code

[](#get-the-http-status-code)

```
require(__DIR__ . '/../vendor/autoload.php');

$response = pulsar()->get('https://jsonplaceholder.typicode.com/posts/1');

echo $response->code();
```

```
200
```

Credits
-------

[](#credits)

- Logo by [Anthony Ledoux](https://thenounproject.com/Vntole/) from [Noun Project](https://thenounproject.com/) (the current version is modified, this is the [original version](https://thenounproject.com/search/?q=black%20hole&i=1667364))

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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 ~30 days

Recently: every ~0 days

Total

15

Last Release

2883d ago

Major Versions

0.0.1 → 1.0.52017-06-02

1.0.9 → v2.0.02018-06-17

v2.1.0 → v3.0.02018-06-18

PHP version history (2 changes)0.0.1PHP &gt;=5.3.0

v2.0.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15908747?v=4)[Anwar](/maintainers/khalyomede)[@khalyomede](https://github.com/khalyomede)

---

Top Contributors

[![port-adhoc2](https://avatars.githubusercontent.com/u/32571986?v=4)](https://github.com/port-adhoc2 "port-adhoc2 (10 commits)")[![khalyomede](https://avatars.githubusercontent.com/u/15908747?v=4)](https://github.com/khalyomede "khalyomede (3 commits)")

---

Tags

curljson-apiphppulsar

### Embed Badge

![Health badge](/badges/khalyomede-pulsar-php/health.svg)

```
[![Health](https://phpackages.com/badges/khalyomede-pulsar-php/health.svg)](https://phpackages.com/packages/khalyomede-pulsar-php)
```

###  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)
