Requests_Transport_cURL::stream_headers() WordPress Method

This method is used to stream the headers of a request. It is useful for when the headers are too large to be stored in memory.

Requests_Transport_cURL::stream_headers( resource $handle, string $headers ) #

Collect the headers as they are received


Parameters

$handle

(resource)(Required)cURL resource

$headers

(string)(Required)Header string


Top ↑

Return

(integer) Length of provided header


Top ↑

Source

File: wp-includes/Requests/Transport/cURL.php

	public function stream_headers($handle, $headers) {
		// Why do we do this? cURL will send both the final response and any
		// interim responses, such as a 100 Continue. We don't need that.
		// (We may want to keep this somewhere just in case)
		if ($this->done_headers) {
			$this->headers      = '';
			$this->done_headers = false;
		}
		$this->headers .= $headers;

		if ($headers === "\r\n") {
			$this->done_headers = true;
		}
		return strlen($headers);
	}

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.