Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mumtazhaqiqy/ci4-psr7-http-messages

This package convert codeigniter4-http object from and to objects implementing HTTP message interfaces defined by PSR-7.
https://github.com/mumtazhaqiqy/ci4-psr7-http-messages

codeigniter4 http-messages psr-7

Last synced: about 2 months ago
JSON representation

This package convert codeigniter4-http object from and to objects implementing HTTP message interfaces defined by PSR-7.

Awesome Lists containing this project

README

        

# CI4 PSR-7 HTTP Messages
This package convert codeigniter4-http object from and to objects implementing HTTP message interfaces defined by PSR-7.

## Instalation

```sh
$ composer require mumtazhaqiqy/ci4-psr7-http-messages

$ composer require nyholm/psr7
```

## Usage

The bridge provides an interface of a factory called
``MumtazHaqiqy\Codeigniter4Psr7\Interfaces\HttpPsr7FactoryInterface``
that builds objects implementing PSR-7 interfaces from ``IncommingRequest`` objects.

The following code snippet explains how to convert a ``CodeIgniter\HTTP\IncomingRequest``
to a ``Nyholm\Psr7\ServerRequest`` class implementing the
``Psr\Http\Message\ServerRequestInterface`` interface:

```php
createRequest($requestCodeIgniter);
```