yosecc / requestjson
yosecc/requestjson
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/yosecc/requestjson
Requires
- guzzlehttp/guzzle: ^7.1@dev
- nikic/fast-route: ^2.0@dev
Requires (Dev)
- phpunit/phpunit: 4.0.*
- vlucas/phpdotenv: ^5.2@dev
README
Install
To install with composer:
composer require yosecc/requestjson
or
git clone https://github.com/Yosecc/RequestJson.git
cd RequestJson/
composer install
php -S localhost:8000
Requires PHP 7.1 or newer. Requires .env (example vlucas/phpdotenv)
Usage
Here's a basic usage example:
<?php require '/path/to/vendor/autoload.php'; $json = new \Yosecc\RequestJson\RequestJson(); echo $json->posts();
Functions
<?php //Listing all resources $json->posts() // Getting a resource $json->post($id) //Creating a resource $json->create_posts($data) //Updating a resource with PUT $json->edit_posts($id, $data) //Updating a resource with PATCH $json->edit_posts_patch($id, $data) //Deleting a resource $json->delete($id)