代码拉取完成,页面将自动刷新
some useful http message library(psr7 implement) of the php
edit composer.json
,at require
add
"inhere/http": "dev-master",
run: composer update
git clone https://gitee.com/inhere/php-http.git // git@osc
git clone https://github.com/inhere/php-http.git // github
use Inhere\Http\Request;
use Inhere\Http\Response;
$request = new Request($method, $uri);
$request = new ServerRequest(... ...);
$response = new Response($code);
... ...
use Inhere\Http\HttpFactory;
$request = HttpFactory::createRequest($method, $uri);
// server request
$request = HttpFactory::createServerRequest('GET', 'http://www.abc.com/home');
$request = HttpFactory::createServerRequestFromArray($_SERVER);
$response = HttpFactory::createResponse($code);
use Inhere\Http\Request;
use Inhere\Http\Extra\ExtendedRequestTrait;
class MyRequest extends Request {
use ExtendedRequestTrait;
}
//
$request = new MyRequest(...);
$age = $request->getInt('age');
$name = $request->getTrimmed('name');
use Inhere\Http\Response;
use Inhere\Http\Extra\ExtendedResponseTrait;
class MyResponse extends Response {
use ExtendedResponseTrait;
}
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。