HttpHeaders
in package
Represents a collection of HTTP headers.
Table of Contents
Methods
- __construct() : mixed
- getHeader() : HttpHeader
- Retrieves a header by name.
- getHeaderFirstLine() : string
- Gets the first line of a header.
- getHeaderLine() : string
- Gets the contents of a header as a string.
- getHeaderLines() : array<string|int, string>
- Gets lines of a header.
- getHeaders() : array<string|int, HttpHeader>
- Retrieves all headers.
- hasHeader() : bool
- Checks if a header is present.
Methods
__construct()
public
__construct(array<string|int, HttpHeader> $headers) : mixed
Parameters
- $headers : array<string|int, HttpHeader>
-
HTTP header instances.
getHeader()
Retrieves a header by name.
public
getHeader(string $name) : HttpHeader
Parameters
- $name : string
-
Name of the header.
Tags
Return values
HttpHeader —Instance of the requested header.
getHeaderFirstLine()
Gets the first line of a header.
public
getHeaderFirstLine(string $name) : string
Parameters
- $name : string
-
Name of the header.
Return values
string —First line of the header.
getHeaderLine()
Gets the contents of a header as a string.
public
getHeaderLine(string $name) : string
Parameters
- $name : string
-
Name of the header.
Return values
string —Contents of the header.
getHeaderLines()
Gets lines of a header.
public
getHeaderLines(string $name) : array<string|int, string>
Parameters
- $name : string
-
Name of the header.
Return values
array<string|int, string> —Header lines.
getHeaders()
Retrieves all headers.
public
getHeaders() : array<string|int, HttpHeader>
Return values
array<string|int, HttpHeader> —All headers.
hasHeader()
Checks if a header is present.
public
hasHeader(string $name) : bool
Parameters
- $name : string
-
Name of the header.
Return values
bool —true if the header is present.