Requests::get_default_options()

最后更新于:2021-11-25 23:23:06

Requests::get_default_options( boolean$multirequest=false)

Get the default options

参数

$multirequest

(boolean) (Optional) Is this a multirequest?

Default value: false

响应

(array) Default option values

源文件

文件: gc-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;
	}