kaythinks/eazycurl
Composer 安装命令:
composer require kaythinks/eazycurl
包简介
This package will make calling API endpoints easier
README 文档
README
This is a PHP Wrapper which makes making API Calls a breeze
There are presently 6 static methods namely;
-
getApiResponse(string $url) : Array -This method returns a JSON Response for unauthenticated API's.
-
getWebContents(string $url) : String -This method returns the contents of a web page.
-
postApiData(array $data, string $url) : Array -This method can be used to post data to an API endpoint
-
postAuthApiData(array $data, string $url, string $token) : Array -This method is for accessing authenticated API endpoints by passing data and token variables
-
getAuthApi(string $url, string $token) : Array -This method is for accessing an authenticated GET endpoint
-
postAuthApi(string $url, string $token) : Array -This method is for accessing an authenticated POST endpoint
To install this package follow the steps below
-- Run composer require kaythinks/eazycurl
-- Run composer dump-autoload
-- The library can be used this way for example;
<?php
require_once 'vendor/autoload.php';
use Kaythinks\Eazycurl\Eazycurl;
echo Eazycurl::getApiResponse('https://jsonplaceholder.typicode.com/todos/11');
统计信息
- 总下载量: 118
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-14