You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A PSR-7 and PSR-17 implementation for HTTP messages and factory.
2
+
A PSR-7 and PSR-17 implementation for HTTP messages and factory.
3
+
An HTTP message is either a request from a client to a server or a response from a server to a client. An HTTP factory is a method by which a new HTTP object, as defined by PSR-7, is created.
3
4
4
5
## Requirements
5
6
* PHP >= 7.1
6
7
7
8
## Installation
8
-
It's recommendend that you use Composer to install this library:
9
+
Using Composer:
9
10
```
10
11
$ composer require davidecesarano/embryo-http
11
12
```
12
13
13
14
## Usage
14
-
coming soon
15
+
### Request
16
+
```php
17
+
$request = (new RequestFactory)->createRequest('GET', 'http://example.com');
18
+
```
19
+
### Server Request
20
+
```php
21
+
// create server request
22
+
$request = (new RequestFactory)->createServerRequest('GET', 'http://example.com');
23
+
24
+
// create server request from server
25
+
$request = (new RequestFactory)->createServerRequestFromServer();
26
+
```
27
+
### Response
28
+
```php
29
+
$request = (new ResponseFactory)->createResponse(200);
0 commit comments