yosecc/requestjson

yosecc/requestjson

dev-main 2020-10-08 12:07 UTC

This package is auto-updated.

Last update: 2025-06-08 23:02:03 UTC


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)