[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/Requests/src/Response/ -> Headers.php (summary)

Case-insensitive dictionary, suitable for HTTP headers

File Size: 127 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Headers:: (5 methods):
  offsetGet()
  offsetSet()
  getValues()
  flatten()
  getIterator()


Class: Headers  - X-Ref

Case-insensitive dictionary, suitable for HTTP headers

offsetGet($offset)   X-Ref
Get the given header

Unlike {@see \WpOrg\Requests\Response\Headers::getValues()}, this returns a string. If there are
multiple values, it concatenates them with a comma as per RFC2616.

Avoid using this where commas may be used unquoted in values, such as
Set-Cookie headers.

return: string|null Header value
param: string $offset Name of the header to retrieve.

offsetSet($offset, $value)   X-Ref
Set the given item

param: string $offset Item name
param: string $value Item value

getValues($offset)   X-Ref
Get all values for a given header

return: array|null Header values
param: string $offset Name of the header to retrieve.

flatten($value)   X-Ref
Flattens a value into a string

Converts an array into a string by imploding values with a comma, as per
RFC2616's rules for folding headers.

return: string Flattened value
param: string|array $value Value to flatten

getIterator()   X-Ref
Get an iterator for the data

Converts the internally stored values to a comma-separated string if there is more
than one value for a key.

return: \ArrayIterator



Generated : Sat Nov 23 08:20:01 2024 Cross-referenced by PHPXref