PHPackages                             fancoders/php-api-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. fancoders/php-api-request

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

fancoders/php-api-request
=========================

package php yang digunakan untuk memudahkan proses http request untuk kebutuhan api integration

v1.0.2(2y ago)04MITPHP

Since Feb 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/IrfanCode25/php-api-request)[ Packagist](https://packagist.org/packages/fancoders/php-api-request)[ Docs](https://github.com/IrfanCode25/php-api-request)[ RSS](/packages/fancoders-php-api-request/feed)WikiDiscussions master Synced 1mo ago

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

php-api-request
===============

[](#php-api-request)

package php yang digunakan untuk memudahkan proses http request untuk kebutuhan api integration

Instalation
-----------

[](#instalation)

```
  composer require fancoders/php-api-request
```

Usage
-----

[](#usage)

```
  require 'vendor/autoload.php';

  use Fancode\PhpApiRequest\ApiRequest;

  $baseUrl = 'https://jsonplaceholder.typicode.com';

  // Inisialisasi objek ApiRequest
  $apiRequest = new ApiRequest($baseUrl);

  // Contoh penggunaan metode GET
  $result = $apiRequest->get('/posts');
  // with query params
  $result = $apiRequest->get('/comments', ['postId' => 1]);

  // Contoh penggunaan metode POST
  $post = $apiRequest->post('/posts', [
   'userId' => 1,
   'title' => 'New Post',
   'body' => 'This is a new post.'
  ]);

  // Contoh penggunaan metode PUT
  $put = $apiRequest->put('/posts/1', [
   'title' => 'Updated Post',
   'body' => 'This post has been updated.'
  ]);

  // Contoh penggunaan metode PATCH
  $patch = $apiRequest->patch('/posts/1', [
   'title' => 'Updated Post',
   'body' => 'This post has been updated.'
  ]);

  // Contoh penggunaan metode DELETE
  $delete = $apiRequest->delete('/posts/1');

  // Tampilkan hasil
  echo "HTTP Status Code: {$result['status']}\n";
  echo "Response Body:\n";
  echo $result['response'] . "\n";
```

Output
------

[](#output)

```
Array
(
    [status] => 200
    [response] => [
  {
    "postId": 1,
    "id": 1,
    "name": "id labore ex et quam laborum",
    "email": "Eliseo@gardner.biz",
    "body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium"
  },
  {
    "postId": 1,
    "id": 2,
    "name": "quo vero reiciendis velit similique earum",
    "email": "Jayne_Kuhic@sydney.com",
    "body": "est natus enim nihil est dolore omnis voluptatem numquam\net omnis occaecati quod ullam at\nvoluptatem error expedita pariatur\nnihil sint nostrum voluptatem reiciendis et"
  },
  {
    "postId": 1,
    "id": 3,
    "name": "odio adipisci rerum aut animi",
    "email": "Nikita@garfield.biz",
    "body": "quia molestiae reprehenderit quasi aspernatur\naut expedita occaecati aliquam eveniet laudantium\nomnis quibusdam delectus saepe quia accusamus maiores nam est\ncum et ducimus et vero voluptates excepturi deleniti ratione"
  },
  {
    "postId": 1,
    "id": 4,
    "name": "alias odio sit",
    "email": "Lew@alysha.tv",
    "body": "non et atque\noccaecati deserunt quas accusantium unde odit nobis qui voluptatem\nquia voluptas consequuntur itaque dolor\net qui rerum deleniti ut occaecati"
  },
  {
    "postId": 1,
    "id": 5,
    "name": "vero eaque aliquid doloribus et culpa",
    "email": "Hayden@althea.biz",
    "body": "harum non quasi et ratione\ntempore iure ex voluptates in ratione\nharum architecto fugit inventore cupiditate\nvoluptates magni quo et"
  }
]
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

3

Last Release

835d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/95d8422b880328407fa6a6bf2b0e5d9e6896bc309e4218403b755fbe8ebd1b61?d=identicon)[fancode](/maintainers/fancode)

---

Top Contributors

[![IrfanCode25](https://avatars.githubusercontent.com/u/26036017?v=4)](https://github.com/IrfanCode25 "IrfanCode25 (3 commits)")

---

Tags

php-api-request

### Embed Badge

![Health badge](/badges/fancoders-php-api-request/health.svg)

```
[![Health](https://phpackages.com/badges/fancoders-php-api-request/health.svg)](https://phpackages.com/packages/fancoders-php-api-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)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

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

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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