Requests_Auth_Basic::__construct() WordPress Method

The Requests_Auth_Basic class is used to connect to a server using basic HTTP authentication. The class takes a username and password as parameters, and uses these to connect to the server.

Requests_Auth_Basic::__construct( array|null $args = null ) #

Constructor


Parameters

$args

(array|null)(Optional)Array of user and password. Must have exactly two elements

Default value: null


Top ↑

Source

File: wp-includes/Requests/Auth/Basic.php

	public function __construct($args = null) {
		if (is_array($args)) {
			if (count($args) !== 2) {
				throw new Requests_Exception('Invalid number of arguments', 'authbasicbadargs');
			}

			list($this->user, $this->pass) = $args;
		}
	}

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.