Skip to content

PHP tool to connect to a REST API using design pattern Singleton and inheritance OOP.

License

Notifications You must be signed in to change notification settings

brnquester/php-restclient-easytouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Rest API Client - Easy-to-Use

Status License


PHP tool to connect to a REST API using design pattern Singleton and inheritance OOP.

📝 Table of Contents

🧐 About

This PHP tool is tested and working just fine. It makes your life really easy to connect and process information to a REST API with no extra packages or libraries.

It was created as a coding exercise applying Inheritance OOP (Object-oriented programming) and design pattern Singleton. It uses CURL to handle all the processes.

🏁 Getting Started

To use it is very simple, you can either directly download the project or use composer. There are no external dependencies.

If you decide to use composer just type:

composer require bruno-canada/php-restclient-easytouse

Prerequisites

PHP 5.5+
CURL mod enabled

🎈 Usage

Check the file "testing.php" or a real ready-to-use example below:

$endpointRoot = "https://restcountries.eu/rest/v2/";
$endpoint = $endpointRoot . "name/brazil";

try {

    $getSales = EASYREST\APIClient::get($endpoint);
    print_r($getSales);

} catch (\Exception $e) {

    echo "Error: " . $e->getMessage();
}

⛏️ Built Using

About

PHP tool to connect to a REST API using design pattern Singleton and inheritance OOP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages