Requests_Response_Headers::offsetSet() WordPress Method

The Requests_Response_Headers::offsetSet() method is used to set the value of a header in a Requests_Response object. The first parameter is the name of the header and the second is the value to set it to.

Requests_Response_Headers::offsetSet( string $key, string $value ) #

Set the given item


Parameters

$key

(string)(Required)Item name

$value

(string)(Required)Item value


Top ↑

Source

File: wp-includes/Requests/Response/Headers.php

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

		$key = strtolower($key);

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

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.