fyre/header

A HTTP header library.

v2.0.7 2024-06-29 01:51 UTC

This package is auto-updated.

Last update: 2024-08-29 02:30:08 UTC


README

FyreHeader is a free, open-source immutable HTTP header library for PHP.

Table Of Contents

Installation

Using Composer

composer require fyre/header

In PHP:

use Fyre\Http\Header;

Header Creation

  • $name is a string representing the header name.
  • $value is a string or array representing the header value.
$header = new Header($name, $value);

Methods

Append Value

Append a value to the header.

  • $value is a string representing the value to append.
$newHeader = $header->appendValue($value);

Get Header String

Get the header string.

$headerString = $header->getHeaderString();

Get Name

Get the header name.

$name = $header->getName();

Get Value

Get the header value.

$value = $header->getValue();

Get Value String

Get the header value as a string.

$value = $header->getValueString();

Prepend Value

Prepend a value to the header.

  • $value is a string representing the value to prepend.
$newHeader = $header->prependValue($value);

Set Value

Set the header value.

  • $value is a string representing the header value.
$newHeader = $header->setValue($value);