mulertech/http-request
最新稳定版本:v1.0.0
Composer 安装命令:
composer require mulertech/http-request
包简介
This package manage http requests
README 文档
README
This package is used to manage the request data.
Installation
Two methods to install Http Request package with composer :
Add to your "composer.json" file into require section :
"mulertech/http-request": "^1.0"
and run the command :
php composer.phar update
Run the command :
php composer.phar require mulertech/http-request "^1.0"
Usage
Get key in session :
$session = new Session();
$session->get('key');
Has key in session :
$session = new Session();
$session->has('key');
Set key in session :
$session = new Session();
$session->set('key', 'value');
Remove key in session :
$session = new Session();
$session->remove('key');
Add key in session :
This method is used to add a key in session if it does not exist.
If the key exists, it will be replaced by the new value only if the key is not an array.
If the key is an array, the new value will be added to the array.
$session = new Session();
$session->add('key', 'value');
Add sub key in session :
$session = new Session();
$session->add('key', 'value', 'path', 'to', 'subkey');
Remove sub key in session :
$session = new Session();
$session->delete('key');
Remove sub key in session :
$session = new Session();
$session->delete('key', 'path', 'to', 'subkey');
Get cookie data :
HttpRequest::getCookie('key');
Has cookie :
HttpRequest::hasCookie('key');
Get $_GET data :
HttpRequest::get('key');
Has Get :
HttpRequest::has('key');
Method :
HttpRequest::method();
Get $_POST data :
HttpRequest::getPost('key');
Has Post :
HttpRequest::hasPost('key');
Get request uri :
HttpRequest::getUri();
Get request url :
HttpRequest::getUrl();
Get post list string :
HttpRequest::getPostListString();
Get post list :
HttpRequest::getPostList();
Get $_GET list :
HttpRequest::getList();
统计信息
- 总下载量: 143
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-27