An amazing layer for dealing with http requests & responses. It's based on guzzle/psr7 Also suports standards PSR1, PSR2, PSR4 and PSR7. And it's reference is rfc3986.
Via Composer, update your composer.json to use martiadrogue/:package_name
"repositories": [
{
"type": "git",
"url": "https://github.com/martiadrogue/:package_name.git"
}
],
"require": {
"martiadrogue/:package_name": "dev-devel"
},
$skeleton = new MartiAdrogue\Http();
echo $skeleton->echoPhrase('Hello, world!');
Please see CHANGELOG for more information what has changed recently.
composer test
run phpcs, phpmd and phpunit. Run phpunit for unit test only.
composer test
composer format
run php-cs-fixer and phpcbf to fix up the PHP code to follow
the coding standards.
composer format
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
Extraction of 3. Syntax Components
from
rfc3986.
The generic URI syntax consists of a hierarchical sequence of components referred to as the scheme, authority, path, query, and fragment.
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
The scheme and path components are required, though the path may be empty (no characters). When authority is present, the path must either be empty or begin with a slash ("/") character. When authority is not present, the path cannot begin with two slash characters ("//"). These restrictions result in five different ABNF rules for a path (Section 3.3), only one of which will match any given URI reference.
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose