Requests_Transport_cURL::stream_headers()

最后更新于:2021-11-26 04:07:10

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

Collect the headers as they are received

参数

$handle

(resource) (Required) cURL resource

$headers

(string) (Required) Header string

响应

(integer) Length of provided header

源文件

文件: gc-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 === "rn") {
			$this->done_headers = true;
		}
		return strlen($headers);
	}