Requests::get_default_options() WordPress Method

The get_default_options() method is a static method of the Requests class. It returns an array of default options used by the Requests class. These options include the base URL, the user agent, the timeout, the connect timeout, the proxy, the headers, and the data.

Requests::get_default_options( boolean $multirequest = false ) #

Get the default options


Description

Top ↑

See also


Top ↑

Parameters

$multirequest

(boolean)(Optional)Is this a multirequest?

Default value: false


Top ↑

Return

(array) Default option values


Top ↑

Source

File: wp-includes/class-requests.php

	protected static function get_default_options($multirequest = false) {
		$defaults = array(
			'timeout'          => 10,
			'connect_timeout'  => 10,
			'useragent'        => 'php-requests/' . self::VERSION,
			'protocol_version' => 1.1,
			'redirected'       => 0,
			'redirects'        => 10,
			'follow_redirects' => true,
			'blocking'         => true,
			'type'             => self::GET,
			'filename'         => false,
			'auth'             => false,
			'proxy'            => false,
			'cookies'          => false,
			'max_bytes'        => false,
			'idn'              => true,
			'hooks'            => null,
			'transport'        => null,
			'verify'           => self::get_certificate_path(),
			'verifyname'       => true,
		);
		if ($multirequest !== false) {
			$defaults['complete'] = null;
		}
		return $defaults;
	}

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.