Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dumindup/rest-api-client
Raw PHP REST API client project
https://github.com/dumindup/rest-api-client
curl curl-multi curlphp json oop php php74 phpunit phpunit-tests rest-api
Last synced: 14 days ago
JSON representation
Raw PHP REST API client project
- Host: GitHub
- URL: https://github.com/dumindup/rest-api-client
- Owner: DuminduP
- Created: 2021-12-26T18:38:40.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-02T02:40:51.000Z (about 3 years ago)
- Last Synced: 2024-11-18T22:40:22.570Z (3 months ago)
- Topics: curl, curl-multi, curlphp, json, oop, php, php74, phpunit, phpunit-tests, rest-api
- Language: PHP
- Homepage:
- Size: 686 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# REST API Client
This project is a raw PHP (7.4+) Supermetrics REST API client project.
This is a sample project for fetching and manipulating JSON data from a fictional Supermetrics Social Network REST API.
Developed an object-oriented code, especially considering design thinking to be generic, extendable, easy to maintain by
other staff members while thinking about performance.No third party libraries were used on this project. Used PHP cURL to connect and communicate with the Supermetrics API.
I have used curl_multi that allows the processing of multiple cURL handles asynchronously. I was able to reduce the run time by ~90% using curl_multi for concurrent requests for 10 pages.# Requirements
* PHP 7.4 or higher needs to be installed.
```
sudo apt-get install php
```
* PHP cURL library must be installed.
```
sudo apt-get install php-curl
```# Installation
1. Clone or download this repository
```
git clone https://github.com/DuminduP/Rest-API-client.git
```
2. Change directory
```
cd rest-client/
```
3. Install phpunit
```
sudo apt install phpunit
```
4. Run unit tests
```
phpunit
```
5. Run sample script to see the summary report.
```
php summary.php
```