1. Go to this page and download the library: Download yiisoft/http library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yiisoft / http example snippets
use Yiisoft\Http\Method;
Method::GET;
Method::POST;
Method::PUT;
Method::DELETE;
Method::PATCH;
Method::HEAD;
Method::OPTIONS;
use Yiisoft\Http\Method;
Method::ALL;
use Yiisoft\Http\Status;
Status::NOT_FOUND;
use Yiisoft\Http\Status;
Status::TEXTS[Status::NOT_FOUND];
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Yiisoft\Http\Header;
use Yiisoft\Http\Status;
class StaticController
{
private ResponseFactoryInterface $responseFactory;
public function actionIndex(): ResponseInterface
{
return $this->responseFactory
->createResponse()
->withStatus(Status::OK)
->withoutHeader(Header::ACCEPT);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.