Files
unirest-php/main/mashape/authentication/BasicAuthentication.php
2012-10-02 15:59:55 -07:00

25 lines
449 B
PHP

<?php
require_once(dirname(__FILE__) . "/HeaderAuthentication.php");
class BasicAuthentication extends HeaderAuthentication {
private $headers;
function __construct($username, $password) {
$headerValue = $username . ":" . $password;
$this->headers = array("Authorization: Basic " . base64_encode($headerValue));
}
public function handleHeaders() {
return $this->headers;
}
public function handleParams() {
return null;
}
}
?>