Skip to content

Commit bddd72a

Browse files
2 parents 04d95c2 + 790a40f commit bddd72a

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
# Embryo Http
2-
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.
34

45
## Requirements
56
* PHP >= 7.1
67

78
## Installation
8-
It's recommendend that you use Composer to install this library:
9+
Using Composer:
910
```
1011
$ composer require davidecesarano/embryo-http
1112
```
1213

1314
## 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);
30+
```
1531

32+
###

0 commit comments

Comments
 (0)