WpOrg\Requests\Response

Headers::offsetSet()publicWP 1.0

Set the given item

Method of the class: Headers{}

No Hooks.

Return

null. Nothing (null).

Usage

$Headers = new Headers();
$Headers->offsetSet( $offset, $value );
$offset(string) (required)
Item name
$value(string) (required)
Item value

Headers::offsetSet() code WP 6.6.2

public function offsetSet($offset, $value) {
	if ($offset === null) {
		throw new Exception('Object is a dictionary, not a list', 'invalidset');
	}

	if (is_string($offset)) {
		$offset = strtolower($offset);
	}

	if (!isset($this->data[$offset])) {
		$this->data[$offset] = [];
	}

	$this->data[$offset][] = $value;
}