mulertech / http-request
This package manage http requests
v1.0.0
2024-10-27 21:14 UTC
Requires
- php: >=8.2
- guzzlehttp/psr7: ^2
- mulertech/array-manipulation: ^2
- mulertech/char-manipulation: ^1
- psr/http-message: ^2
Requires (Dev)
- phpunit/phpunit: ^10
This package is auto-updated.
Last update: 2025-03-07 23:31:42 UTC
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();