Skip to content
This repository was archived by the owner on Dec 31, 2022. It is now read-only.

Commit ff40158

Browse files
committed
Update README.md
1 parent 280cb19 commit ff40158

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,34 @@ composer require sunrise/http-header-kit
1616

1717
## How to use?
1818

19+
### HTTP Header Collection
20+
21+
> More useful information: https://github.com/sunrise-php/http-header-collection
22+
23+
```bash
24+
composer require sunrise/http-header-collection
25+
```
26+
27+
```php
28+
// Creates the header collection
29+
$headers = new \Sunrise\Http\Header\HeaderCollection([
30+
new \Sunrise\Http\Header\HeaderAllow('OPTIONS', 'HEAD', 'GET'),
31+
new \Sunrise\Http\Header\HeaderContentLanguage('de-DE'),
32+
new \Sunrise\Http\Header\HeaderContentType('application/json'),
33+
]);
34+
35+
// Sets headers to the message
36+
$message = $headers->setToMessage($message);
37+
38+
// ... or adds headers to the message
39+
$message = $headers->addToMessage($message);
40+
41+
// ...or converts headers to an array
42+
$headers->toArray();
43+
```
44+
45+
### HTTP Headers
46+
1947
#### Access-Control-Allow-Credentials
2048

2149
> Usage link: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials

0 commit comments

Comments
 (0)