vzool/url
Composer 安装命令:
composer require vzool/url
包简介
A Simple RESTful HTTP Client Library using file_get_contents only
README 文档
README
Install
composer require vzool/url
Usage
require_once __DIR__.'/vendor/autoload.php'; use vzool\URL\URL; $http = new URL('https://jsonplaceholder.typicode.com'); // to GET $result = $http->GET('/posts/1'); // to POST $result = $http->POST('/posts', [ "title" => "Agreement", "body" => "Ha ha ha", "author" => "Aziz", ]); // to PUT $result = $http->PUT('/posts/1', [ "title" => "Agreement #2", ]); // to DELETE $result = $http->DELETE('/posts/1'); // or $result = $http->delete('/posts/1'); // to get result print_r($result->content()); // returns stdClass objects :) print_r($result->toArray()); // returns array print_r($result->toJson()); // returns raw response, I'm a JSON Patriot ;)
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-06