WpOrg\Requests\Response
Headers::offsetSet
Set the given item
Method of the class: Headers{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Headers = new Headers(); $Headers->offsetSet( $offset, $value );
- $offset(string) (required)
- Item name.
- $value(string) (required)
- Item value.
Headers::offsetSet() Headers::offsetSet code WP 6.8.3
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;
}