WordPress at a glance
function is not described

Requests_Cookie_Jar::before_request() public WP 1.0

Add Cookie header to a request if we have any

As per RFC 6265, cookies are separated by '; '

{} It's a method of the class: Requests_Cookie_Jar{}

No Hooks.

Return

Null. Nothing.

Usage

$Requests_Cookie_Jar = new Requests_Cookie_Jar();
$Requests_Cookie_Jar->before_request( $url, $headers, $data, $type, $options );
$url(string) (required)
$headers(array) (required) (passed by reference — &)
$data(array) (required) (passed by reference — &)
$type(string) (required) (passed by reference — &)
$options(array) (required) (passed by reference — &)

Code of Requests_Cookie_Jar::before_request() WP 5.5.1

<?php
public function before_request($url, &$headers, &$data, &$type, &$options) {
	if (!$url instanceof Requests_IRI) {
		$url = new Requests_IRI($url);
	}

	if (!empty($this->cookies)) {
		$cookies = array();
		foreach ($this->cookies as $key => $cookie) {
			$cookie = $this->normalize_cookie($cookie, $key);

			// Skip expired cookies
			if ($cookie->is_expired()) {
				continue;
			}

			if ($cookie->domain_matches($url->host)) {
				$cookies[] = $cookie->format_for_header();
			}
		}

		$headers['Cookie'] = implode('; ', $cookies);
	}
}