/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Http
NameSizeModeActions
Client/-0755rm
Cookie/-0755rm
Exception/-0755rm
Middleware/-0755rm
Session/-0755rm
BaseApplication.php74090644editdlrm
CallbackStream.php15250644editdlrm
Client.php218350644editdlrm
composer.json13980644editdlrm
ControllerFactory.php2300644editdlrm
ControllerFactoryInterface.php15340644editdlrm
CorsBuilder.php59990644editdlrm
LICENSE.txt12040644editdlrm
MiddlewareApplication.php17910644editdlrm
MiddlewareQueue.php89370644editdlrm
README.md29300644editdlrm
Response.php503320644editdlrm
ResponseEmitter.php88860644editdlrm
Runner.php28300644editdlrm
Server.php56690644editdlrm
ServerRequest.php563530644editdlrm
ServerRequestFactory.php126890644editdlrm
Session.php202200644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Http/README.md (2930B)
[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/http.svg?style=flat-square)](https://packagist.org/packages/cakephp/http) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt) # CakePHP Http Library This library provides a PSR-15 Http middleware server, PSR-7 Request and Response objects, and a PSR-18 Http Client. Together these classes let you handle incoming server requests and send outgoing HTTP requests. ## Using the Http Client Sending requests is straight forward. Doing a GET request looks like ```php use Cake\Http\Client; $http = new Client(); // Simple get $response = $http->get('http://example.com/test.html'); // Simple get with querystring $response = $http->get('http://example.com/search', ['q' => 'widget']); // Simple get with querystring & additional headers $response = $http->get('http://example.com/search', ['q' => 'widget'], [ 'headers' => ['X-Requested-With' => 'XMLHttpRequest'], ]); ``` To learn more read the [Http Client documentation](https://book.cakephp.org/4/en/core-libraries/httpclient.html). ## Using the Http Server The Http Server allows an `HttpApplicationInterface` to process requests and emit responses. To get started first implement the `Cake\Http\HttpApplicationInterface` A minimal example would could look like: ```php namespace App; use Cake\Core\HttpApplicationInterface; use Cake\Http\MiddlewareQueue; class Application implements HttpApplicationInterface { /** * Load all the application configuration and bootstrap logic. * * @return void */ public function bootstrap(): void { // Load configuration here. This is the first // method Cake\Http\Server will call on your application. } /** * Define the HTTP middleware layers for an application. * * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to set in your App Class * @return \Cake\Http\MiddlewareQueue */ public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue { // Add middleware for your application. return $middlewareQueue; } } ``` Once you have an application with some middleware. You can start accepting requests. In your application's webroot, you can add an `index.php` and process requests: ```php emit($server->run()); ``` You can then run your application using PHP's built in webserver: ```bash php -S localhost:8765 -t ./webroot ./webroot/index.php ``` For more information on middleware, [consult the documentation](https://book.cakephp.org/4/en/controllers/middleware.html)