wp_get_server_protocol() – Return the HTTP protocol sent by the server.

You appear to be a bot. Output may be restricted

Description

Return the HTTP protocol sent by the server.

Usage

$string = wp_get_server_protocol();

Parameters

Returns

string The HTTP protocol. Default: HTTP/1.0.

Source

File name: wordpress/wp-includes/load.php
Lines:

1 to 7 of 7
function wp_get_server_protocol() {
  $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';
  if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
    $protocol = 'HTTP/1.0';
  }
  return $protocol;
}
 

 View on GitHub View on Trac