https://github.com/elusivecodes/fyreheader
FyreHeader is a free, open-source HTTP header library for PHP.
https://github.com/elusivecodes/fyreheader
header http php
Last synced: 5 months ago
JSON representation
FyreHeader is a free, open-source HTTP header library for PHP.
- Host: GitHub
- URL: https://github.com/elusivecodes/fyreheader
- Owner: elusivecodes
- License: mit
- Created: 2021-11-30T09:23:37.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-29T01:51:41.000Z (over 1 year ago)
- Last Synced: 2024-08-30T07:57:55.770Z (over 1 year ago)
- Topics: header, http, php
- Language: PHP
- Homepage:
- Size: 49.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FyreHeader
**FyreHeader** is a free, open-source immutable HTTP header library for *PHP*.
## Table Of Contents
- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Methods](#methods)
## Installation
**Using Composer**
```
composer require fyre/header
```
In PHP:
```php
use Fyre\Http\Header;
```
## Basic Usage
- `$name` is a string representing the header name.
- `$value` is a string or array representing the header value.
```php
$header = new Header($name, $value);
```
## Methods
**Append Value**
Append a value to the header.
- `$value` is a string representing the value to append.
```php
$newHeader = $header->appendValue($value);
```
**Get Header String**
Get the header string.
```php
$headerString = $header->getHeaderString();
```
**Get Name**
Get the header name.
```php
$name = $header->getName();
```
**Get Value**
Get the header value.
```php
$value = $header->getValue();
```
**Get Value String**
Get the header value as a string.
```php
$value = $header->getValueString();
```
**Prepend Value**
Prepend a value to the header.
- `$value` is a string representing the value to prepend.
```php
$newHeader = $header->prependValue($value);
```
**Set Value**
Set the header value.
- `$value` is a string representing the header value.
```php
$newHeader = $header->setValue($value);
```