yosecc/requestjson

yosecc/requestjson

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

This package is auto-updated.

Last update: 2024-09-08 21:17:44 UTC


README

安装

使用composer安装

composer require yosecc/requestjson

or

git clone https://github.com/Yosecc/RequestJson.git
cd RequestJson/
composer install
php -S localhost:8000
  

需要PHP 7.1或更高版本。需要.env文件(例如vlucas/phpdotenv)

用法

以下是一个基本的用法示例

<?php

require '/path/to/vendor/autoload.php';
$json = new \Yosecc\RequestJson\RequestJson();
echo $json->posts();

函数

<?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)