http_request_version filter-hookWP 2.7.0

Filters the version of the HTTP protocol used in a request.

Usage

add_filter( 'http_request_version', 'wp_kama_http_request_version_filter', 10, 2 );

/**
 * Function for `http_request_version` filter-hook.
 * 
 * @param string $version Version of HTTP used. Accepts '1.0' and '1.1'.
 * @param string $url     The request URL.
 *
 * @return string
 */
function wp_kama_http_request_version_filter( $version, $url ){

	// filter...
	return $version;
}
$version(string)
Version of HTTP used. Accepts '1.0' and '1.1'.
Default: '1.0'
$url(string)
The request URL.

Changelog

Since 2.7.0 Introduced.
Since 5.1.0 The $url parameter was added.

Where the hook is called

WP_Http::request()
http_request_version
wp-includes/class-wp-http.php 182
'httpversion'         => apply_filters( 'http_request_version', '1.0', $url ),

Where the hook is used in WordPress

Usage not found.